Request API key

Dispatch API

The Dispatch platform is built to help field service businesses and on-demand marketplaces stay connected with their providers and consumers. It is built from the ground up on SOA (Service-Oriented Architecture) principles. The Dispatch API allows for complete first-class interaction, allowing for deep integrations and cutting-edge applications.

Dispatch API

https://api.dispatch.me

https://events-api.dispatch.me

https://files-api.dispatch.me

https://locations-api.dispatch.me

Main Endpoints

https://api.dispatch.me

https://events-api.dispatch.me

https://files-api.dispatch.me

https://locations-api.dispatch.me

API Key

For access to the developer sandbox, please email: platform@dispatch.me

Requests

All requests must be made over HTTPS. All data is sent and received as JSON.

When making requests, you receive data as JSON by properly setting the Accept header to application/json, as shown in the example below:

$ curl https://api.dispatch.me/v1/jobs/?filter[id_in][]=:id \
-H 'Accept: application/json'

When creating or modifying resources, you need to send the data as JSON by properly setting the Content-Type header to application/json, as shown below:

$ curl https://api.dispatch.me/v1/jobs \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"title":"Test"}'

Responses

All responses will be JSON representations of the requested resource(s) or error message(s).

Single resources will always be returned as a top level object:

{
  "field": "value"
}

Collections of resources will always be returned as a top level array of objects:

[
  {
    "field": "value"
  },
  {
    "field": "value"
  }
]

Timestamps

Timestamps will always be returned in UTC using the standard ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

Verbs

GET: Used for retrieving a resource or collection of resources

POST: Used for creating a resource

UPDATE: Used for updating an entire resource

PATCH: Used for partial updates to a resource

DELETE: Used for deleting a resource

Response Codes

SUCCESSFUL REQUESTS

200 OK: Generic success code used for most methods

201 Created: Used for requests that create new objects, usually POST type requests.

204 No Content: Typically used for DELETE type requests when server successfully performed the operation and has no content torespond with.

ERRORS

400 Bad Request: The request lacks information required by its context. The response body will contain more specific message.

401 Unauthorized: The requester is not authorized to perform the specified request or Bearer header contains expired/invalid access_token, requester needs to refresh his access_token

403 Forbidden: The requester is not authenticated to perform the specified request. For example, a technician tries to access another technician's data.

404 Not Found: The requested resource is not found

422 Unprocessable Entry: The request contains invalid information. The response body will contain more specific messages.

50x Server side error: Undetermined error

Authentication

All requests to the endpoint are made over SSL using the https protocol. Authentication is made by OAuth 2.0. Each request should contain application key and secret or Bearer header with access_token for the User. Most of the resources required authenticated user with according role.

Cross-origin Resource Sharing (CORS)

Cross-origin resource sharing (CORS) is a mechanism that allows many resources (e.g., fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.

To initiate a cross-origin request, a browser sends the request with an Origin HTTP header.

Origin: http://www.foo.com

At this moment Dispatch Platform APIs return only JSON data and do not pre-render response blocks. Therefore to simplify client development we use wildcard header responses from APIs

Access-Control-Allow-Origin: *

Filtering, Sorting and Pagination

Nearly all GET queries within the Dispatch API support filtering, sorting and pagination. There are all optional, as there is a default sort order for each method. Using these, you can customize the flow of information to best suit your application's needs.

Sorting

Sort records based on a given field and direction (asc or desc):

sort[]='name asc'

Multiple sorts can be done by:

sort[]='name asc', 'created_at desc'

Pagination

Pagination is controlled by specifying (page) offset and (item) limit (per page):

offset=5
limit=10

Filtering

The primary method of searching is by using what is known as predicates.

Predicates are used within search queries to determine what information to match. For instance, the cont predicate will check to see if an attribute called "first_name" contains a value using a wildcard query:

>> User.search(first_name_cont: 'Rya').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."first_name" LIKE '%Rya%')

You can also combine predicates for OR queries:

>> User.search(first_name_or_last_name_cont: 'Rya').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."first_name" LIKE '%Rya%'
OR "users"."last_name" LIKE '%Rya%')

The syntax for OR queries on an associated model is not immediately obvious, but makes sense. Assuming a User has_one Account and the Account has attributes foo and bar:

>> User.search(account_foo_or_account_bar: 'val').result.to_sql
=> SELECT "users".* FROM "users" INNER JOIN accounts ON accounts.user_id = users.id WHERE ("accounts.foo LIKE '%val%' OR accounts.bar LIKE '%val%')

Below is a list of the predicates of Dispatch and their opposites.

Please note: any attempt to use a predicate for an attribute that does not exist will silently fail. For instance, this will not work when there is no name attribute:

>> User.search(name_cont: 'Rya').result.to_sql
=> "SELECT "users".* FROM "users"

eq (equals)

The eq predicate returns all records where a field is exactly equal to a given value:

>> User.search(first_name_eq: 'Ryan').result.to_sql
=> SELECT "users".* FROM "users" WHERE "users"."first_name" = 'Ryan'

Opposite: not_eq

matches

The matches predicate returns all records where a field is like a given value:

>> User.search(first_name_matches: 'Ryan').result.to_sql
=> SELECT "users".* FROM "users" WHERE ("users"."first_name" LIKE 'Ryan')

Opposite: does_not_match

Note: If you want to do wildcard matching, you may be looking for the cont/not_cont predicates instead.

lt (less than)

The lt predicate returns all records where a field is less than a given value:

>> User.search(age_lt: 25).result.to_sql
=> SELECT "users".* FROM "users" WHERE ("users"."age" < 25)

Opposite: gt (greater than)

lteq (less than or equal to)

The lteq predicate returns all records where a field is less than or equal to a given value:

>> User.search(age_lteq: 25).result.to_sql
=> SELECT "users".* FROM "users" WHERE ("users"."age" <= 25)

Opposite: gteq (greater than or equal to)

in

The in predicate returns all records where a field is within a specified list:

>> User.search(age_in: 20..25).result.to_sql
=> SELECT "users".* FROM "users" WHERE "users"."age" IN (20, 21, 22, 23, 24, 25)

It can also take an array:

>> User.search(age_in: [20, 21, 22, 23, 24, 25]).result.to_sql
=> SELECT "users".* FROM "users" WHERE "users"."age" IN (20, 21, 22, 23, 24, 25)

Opposite: not_in

cont

The cont predicate returns all records where a field contains a given value:

>> User.search(first_name_cont: 'Rya').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."first_name" LIKE '%Rya%')

Opposite: not_cont

i_cont

The i_cont case-insensitive predicate returns all records where a field contains a given value and ignores case:

>> User.search(first_name_i_cont: 'Rya').result.to_sql
=> SELECT "users".* FROM "users"  WHERE (UPPER("users"."first_name") LIKE UPPER('%Rya%'))

Opposite: i_not_cont

start (starts with)

The start predicate returns all records where a field begins with a given value:

>> User.search(first_name_start: 'Rya').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."first_name" LIKE 'Rya%')

Opposite: not_start

end (ends with)

The end predicate returns all records where a field ends with a given value:

>> User.search(first_name_end: 'yan').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."first_name" LIKE '%yan')

Opposite: not_end

true

The true predicate returns all records where a field is true. The '1' indicates that you indeed want to check the truthiness of this field. The other truthy values are 'true', 'TRUE', 't' or 'T'.

>> User.search(awesome_true: '1').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."awesome" = 't')

Note: different database systems use different values to represent truth.

Opposite: not_true

false

The false predicate returns all records where a field is false.

>> User.search(awesome_false: '1').result.to_sql
=> SELECT "users".* FROM "users"  WHERE ("users"."awesome" = 'f')

Opposite: not_false

Note: the false predicate may be considered the opposite of the true predicate if the field does not contain null values. Otherwise, use not_false.

present

The present predicate returns all records where a field is present (not null and not a blank string).

>> User.search(first_name_present: '1')
=> SELECT "users".* FROM "users"  WHERE (("users"."first_name" IS NOT NULL AND "users"."first_name" != ''))

Opposite: blank

null

The null predicate returns all records where a field is null:

>> User.search(first_name_null: 1).result.to_sql
=> SELECT "users".* FROM "users"  WHERE "users"."first_name" IS NULL

Opposite: not_null

Locations API

Locations API is used to track technicians, query they last known location and calculate distance driven.

Endpoint

https://locations-api.dispatch.me

Posting locations

Submit technician's location for later use, for example: travel distance calculation

Parameters

Parameter Required Type Description
uid required string Some unique identifier for technician
lat required float Location latitude
lng required float Location longitude
address optional string Address related to location, for example: "Summer Street 10, Boston, MA", or "Boston, MA"
created_at optional datetime Time when location was captured, if none provided then request time will be used

Request

ROUTE
POST /v1/locations.json
CONTENT_TYPE

application/json

HTTP_ACCEPT

application/json

HTTP_AUTHORIZATION

Bearer ACCESS_TOKEN

BODY
{
uid: 'technician:1',
lat: 42.359432,
lng: -71.058455,
address: 'Summer Street',
created_at: '2014-02-11T21:20:29+02:00'
}

Response

BODY
{
  location: {
    uid: 'technician:1',
    lat: 42.359432,
    lng: -71.058455,
    address: 'Summer Street',
    created_at: '2014-02-11T91:20:29Z'
  }
}

Get Last location

Returns last known location of technician by his UID

Parameters

Parameter Required Type Description
access_token required string Your OAuth token obtained via api.dispatch.me/oauth
uid required string Some unique identifier for technician

Request

ROUTE
GET /v1/locations/:uid.json?access_token=ACCESS_TOKEN

Response

BODY
{
  location: {
    uid: 'technician:1',
    lat: '42.359432',
    lng: '-71.058455',
    address: 'Summer Street',
    created_at: '2014-02-11T21:20:29Z'
  }
}

Distance driven by technician

Returns distance driven by technician between two points in time

Parameters

Parameter Required Type Description
access_token required string Your OAuth token obtained via api.dispatch.me/oauth
uid required string Some unique identifier for technician
from_date required datetime Start time to calculate distance
to_date required datetime End time to calculate distance

Request

ROUTE
GET /v1/distance/:uid.json?from_date=:from_date&to_date=:to_date&access_token=ACCESS_TOKEN

Response

BODY
{
  distance: {
    km: "15.5",
    miles: "9.6"
  }
}

Files API

Files API stores files and cuts images for few sizes: 50, 100, 250 pixels (proportional, square, vertical)

Endpoint

https://files-api.dispatch.me

Uploading a file

Uploaded file will be processed in background but API will return file token immediately

Parameters

Parameter Required Type Description
file required binary File content, multipart/form-data
filename required string Uploaded filename
name required string Some human readable name or short description

Request

ROUTE
POST /v1/datafiles
CONTENT_TYPE

application/json

HTTP_ACCEPT

application/json

HTTP_AUTHORIZATION

Bearer ACCESS_TOKEN

BODY
{
  file: BINARY,
  filename: 'test.txt',
  name: 'Test'
}

Response

BODY
{
  datafile: {
    uid: '00000000-0000-0000-0000-000000000000',
    filename: 'test.txt',
    name: 'Test',
    created_at: '2014-12-31T23:59:59Z'
  }
}

Download a file

Download particular version of a file by it's uid. Available versions are square_50, square_100, square_250, proportional_50, proportional_100, proportional_250. If no version provided then original file will be downloaded

Parameters

Parameter Required Type Description
uid required string UID of a file
format optional string One of square_50, square_100, square_250, proportional_50, proportional_100, proportional_250, vertical_50, vertical_100, vertical_250

Request

ROUTE
GET /v1/datafiles/:uid/:format

Response

BODY
BINARY CONTENT OF A FILE

Get file information

Returns information about stored file in JSON format

Parameters

Parameter Required Type Description
uid required string UID of a file

Request

ROUTE
GET /v1/datafiles/:uid.json

Response

BODY
{
  datafile: {
    uid: '00000000-0000-0000-0000-000000000000',
    filename: 'test.txt',
    name: 'Test',
    created_at: '2014-12-31T23:59:59Z'
  }
}

Push file to bucket

Parameters

Parameter Required Type Description
file required binary File content, multipart/form-data
filename required string Uploaded filename
name required string Some human readable name or short description
bucket_id optional string UID of a bucket

Request

ROUTE
POST /v1/datafiles
CONTENT_TYPE

application/json

HTTP_ACCEPT

application/json

HTTP_AUTHORIZATION

Bearer ACCESS_TOKEN

BODY
{
  file: BINARY,
  filename: 'test.txt',
  name: 'Test',
  bucket_id: '00000000-0000-0000-0000-000000000000'
}

Response

BODY
{
  datafile: {
    uid: '00000000-0000-0000-0000-000000000000',
    filename: 'test.txt',
    name: 'Test',
    created_at: '2014-12-31T23:59:59Z',
    bucket_id: '00000000-0000-0000-0000-000000000000'
  }
}

Get all files from bucket

Parameters

Parameter Required Type Description
bucket_id required string UID of a file

Request

ROUTE
GET /v1/bucket/:bucket_id.json

Response

BODY
{
  bucket_id: '00000000-0000-0000-0000-000000000000',
  datafiles:[
    {
      uid: '00000000-0000-0000-0000-000000000000',
      filename: 'test.txt',
      name: 'Test',
      created_at: '2014-12-31T23:59:59Z',
      bucket_id: '00000000-0000-0000-0000-000000000000'
    },
    {
      uid: '00000000-0000-0000-0000-000000000002',
      filename: 'test2.txt',
      name: 'Test',
      created_at: '2014-12-31T23:59:59Z',
      bucket_id: '00000000-0000-0000-0000-000000000000'
    }
  ]
}

External IDs API

External IDs API is used to track dependencies between 3rd party IDs and Dispatch IDs, for example between Vendor ID=30 (3rd party) and Organization ID=2835 (Dispatch)

Endpoint

https://external-ids-api.dispatch.me

Creating record

Create association between 3rd party entity and dispatch entity

Parameters

Parameter Required Type Description
dispatch_type required string Entity name in Dispatch, one of Organization, User, Customer, Job, Appointment, Invoice, Estimate, Payment, Address, etc.
dispatch_id required integer Entity ID in Dispatch
type required string Entity name in 3rd party system
id required integer Entity ID in 3rd party system
client required string Client identifier, for example "MyCompanyAPI"

Request

ROUTE
POST v1/records.json
CONTENT_TYPE

application/json

HTTP_ACCEPT

application/json

HTTP_AUTHORIZATION

Bearer ACCESS_TOKEN

BODY
{
  "dispatch_type": "Customer",
  "dispatch_id": "123",
  "type": "Contact",
  "id": "abc",
  "client": "my_company"
}

Response

BODY
{
  "records": [{
    "dispatch_type": "customer",
    "dispatch_id":   "123",
    "type":          "contact",
    "id":            "abc",
    "client":        "my_company",
    "created_at":    "2014-12-31T01:25:25Z"
  }]
}

Get records

Returns record associated with requested parameters.
Note that "client" and a pair of dispatch or 3rd party parameters (id and type) are required for lookup that verifies existence of both records in both sides.
For any other lookup, just one of the following parameters is enough

Parameters

Parameter Required Type Description
dispatch_id optional integer Entity ID in Dispatch
dispatch_type optional string Entity type in Dispatch
type optional string Entity name in 3rd party system
id optional integer Entity ID in 3rd party system
client optional string Client identifier, for example "my_company"

Request

ROUTE
GET v1/records.json?filter[type]=:3rd_party_type&filter[id]=:3rd_party_id&filter[client]=:client?access_token=ACCESS_TOKEN

Response

BODY
{
  "records": [{
    "dispatch_type": "customer",
    "dispatch_id":   "123",
    "client":        "my_company",
    "type":          "contact",
    "id":            "abc",
    "created_at":    "2014-12-31T01:25:25Z"
  }, {
    "dispatch_type": "customer",
    "dispatch_id":   "123",
    "client":        "my_company",
    "type":          "user",
    "id":            "234",
    "created_at":    "2014-12-31T01:35:25Z"
  }]
}

Authentication

Get token with client info

Request

ROUTE
POST /oauth/token
HEADERS
Content-Type

application/x-www-form-urlencoded

Accept

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

QUERY
{
  "grant_type" : "client_credentials",
  "client_id" : "2ac8a729c1bf00b7b46472c5c105dccdaa4b857dec394c3b356810bf9b4c110e",
  "client_secret" : "a825e898010ecd3c9d1c73e89dba3ea4a20be20507bb98db942e2cb19cfdf38d"
}
BODY

grant_type=client_credentials&client_id=2ac8a729c1bf00b7b46472c5c105dccdaa4b857dec394c3b356810bf9b4c110e&client_secret=a825e898010ecd3c9d1c73e89dba3ea4a20be20507bb98db942e2cb19cfdf38d

Response

HEADERS
Pragma

no-cache

Content-Type

application/json; charset=utf-8

Content-Length

148

BODY
{
  "access_token" : "950fcd4b9bad2f8182ab0cd3140c30da0d936bca10e7b2929716bdae8fdcea39",
  "token_type" : "bearer",
  "expires_in" : 10800,
  "created_at" : 1455034038
}

Get token with password

Request

ROUTE
POST /oauth/token
HEADERS
Content-Type

application/x-www-form-urlencoded

Accept

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

QUERY
{
  "grant_type" : "password",
  "username" : "user-186@example.com",
  "password" : "qwe123456",
  "client_id" : "fa2b364d77da8519069c291ab24b5f95ce7781d3c6e2cfd1063fe70449ed18c3",
  "client_secret" : "1dd1c93f35b1d5df34318dc22787ac49e10ff197e36a9262898e9dedba352018"
}
BODY

grant_type=password&username=user-186%40example.com&password=qwe123456&client_id=fa2b364d77da8519069c291ab24b5f95ce7781d3c6e2cfd1063fe70449ed18c3&client_secret=1dd1c93f35b1d5df34318dc22787ac49e10ff197e36a9262898e9dedba352018

Response

HEADERS
Pragma

no-cache

Content-Type

application/json; charset=utf-8

Content-Length

231

BODY
{
  "access_token" : "c6afc72af3a89ae8707c7181405342848eed0875249252506e7fa275f9efc99f",
  "token_type" : "bearer",
  "expires_in" : 10800,
  "refresh_token" : "c5b13cae5f0b00b14a382f2d7b9e77500d1597e2926e92990ecec3e9a24083e4",
  "created_at" : 1455034038
}

Get token with refresh token

Request

ROUTE
POST /oauth/token
HEADERS
Content-Type

application/x-www-form-urlencoded

Accept

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

QUERY
{
  "grant_type" : "refresh_token",
  "refresh_token" : "cc8f8a387c1875e2ec679808877bb17203e4603bef5e7b4400f7cdb3a4c3a851",
  "client_id" : "60de9b32aa266c6840b7518f5ae33cb1bdf0060e705c3b4fa8f6373d8cf9509a",
  "client_secret" : "072fbe9b2aeeb53d20e274ea5c043aad213509518c4196f824b1748fc90a8f42"
}
BODY

grant_type=refresh_token&refresh_token=cc8f8a387c1875e2ec679808877bb17203e4603bef5e7b4400f7cdb3a4c3a851&client_id=60de9b32aa266c6840b7518f5ae33cb1bdf0060e705c3b4fa8f6373d8cf9509a&client_secret=072fbe9b2aeeb53d20e274ea5c043aad213509518c4196f824b1748fc90a8f42

Response

HEADERS
Pragma

no-cache

Content-Type

application/json; charset=utf-8

Content-Length

231

BODY
{
  "access_token" : "ff8398d28b834bed701fd4191252c99ff6df822528b27dbd36ce6d1d2be1d7f2",
  "token_type" : "bearer",
  "expires_in" : 10800,
  "refresh_token" : "4dbc76aa2a293fbd0b5c5b499db61d64b792b370220290f22e47d731eabf2952",
  "created_at" : 1455034038
}

Get token information

Request

ROUTE
GET /oauth/token/info
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

176

BODY
{
  "resource_owner_id" : 185,
  "scopes" : [],
  "expires_in_seconds" : null,
  "application" : {
    "uid" : "06d5a53e987ac6979e475d679695c2552e7f0760e8f110fbd7fdc57e980433ec"
  },
  "created_at" : 1455034037
}

Retrieve info about token

Returns information about current user or account

Request

ROUTE
GET /v1/me
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1106

BODY
{
  "user" : {
    "id" : 233,
    "uid" : "788ddc76-f0ed-4acf-bee8-f7803b9e777a",
    "organization_id" : 180,
    "first_name" : "Bob 233",
    "last_name" : "Smith 233",
    "full_name" : "Bob 233 Smith 233",
    "photo_token" : "e32bf124-f3d7-4308-934b-8bed3e3b9376",
    "email" : "user-233@example.com",
    "phone_number" : "+15555550230",
    "mobile_verified" : true,
    "mobile_verified_at" : "2016-02-09T16:07:32+0000",
    "occupation" : "electrician",
    "roles" : [],
    "service_types" : [],
    "created_at" : "2016-02-09T16:07:32+0000",
    "updated_at" : "2016-02-09T16:07:32+0000",
    "working_hours" : {
      "0" : [],
      "1" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "2" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "3" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "4" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "5" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "6" : []
    },
    "latitude" : null,
    "longitude" : null,
    "address_resolved" : null,
    "notes" : null,
    "custom_fields" : {},
    "is_admin" : false,
    "last_sign_in_at" : null,
    "is_available_for_job_offers" : true,
    "deleted_at" : null,
    "timezone" : "Eastern Time (US & Canada)",
    "meta" : {},
    "is_configured" : true,
    "version" : "v1",
    "updated_by" : "system",
    "external_ids" : [],
    "address" : null,
    "profiles" : []
  }
}

Account Endpoint

Create endpoint URL

Creates Account Endpoint from given parameters. Account Endpoint specifies an URL to send Event notifications for all clients of Account

Parameters

Parameter Required Type Description
account_id required Integer Account ID
client required String Client name
endpoint_uri required String URL to which Event notification will be sent
entity_type required String Type of Entity, which is accepted by given "endpoint_uri".
Allowed entity types are "Job", "Organization", "Invoice", "Estimate", "User", "Payment",
"CustomJobField", "CustomUserField", "CustomCustomerField", "Customer", "Inventory", "JobOffer".
If there is a single endpoint to accept all notifications on all events, use "default" entity_type

Request

ROUTE
POST /v1/account_endpoints
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "account_id" : 1,
  "client" : "account1",
  "endpoint_uri" : "http://example.com/test",
  "entity_type" : "Job",
  "events" : "*",
  "skip_origin" : false
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

275

BODY
{
  "account_endpoint" : {
    "id" : 1,
    "account_id" : 1,
    "client" : "account1",
    "entity_type" : "Job",
    "endpoint_uri" : "http://example.com/test",
    "events" : "*",
    "active" : true,
    "total_runs" : 0,
    "failures" : 0,
    "skip_origin" : false,
    "version" : "v1",
    "updated_by" : "account:1e260692-79b4-48b6-a7e9-9644528bfecc"
  }
}

List endpoints

Returns available Account Endpoints

Request

ROUTE
GET /v1/account_endpoints
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

465

BODY
{
  "account_endpoints" : [
    {
      "id" : 4,
      "account_id" : 6,
      "client" : "zzgd_3",
      "entity_type" : "Job",
      "endpoint_uri" : "http://example.com/some_url/3",
      "events" : null,
      "active" : true,
      "total_runs" : 0,
      "failures" : 0,
      "skip_origin" : true,
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 3,
      "account_id" : 5,
      "client" : "zzgd_2",
      "entity_type" : "Job",
      "endpoint_uri" : "http://example.com/some_url/2",
      "events" : null,
      "active" : true,
      "total_runs" : 0,
      "failures" : 0,
      "skip_origin" : true,
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Delete endpoint

Deletes Account Endpoint

Request

ROUTE
DELETE /v1/account_endpoints/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "2"
}
BODY
{}

Response

Update endpoint

Updates Account Endpoint

Parameters

Parameter Required Type Description
account_id required Integer Account ID
client required String Client name
endpoint_uri required String URL to which Event notification will be sent
entity_type required String Type of Entity, which is accepted by given "endpoint_uri".
Allowed entity types are "Job", "Organization", "Invoice", "Estimate", "User", "Payment",
"CustomJobField", "CustomUserField", "CustomCustomerField", "Customer", "Inventory", "JobOffer".
If there is a single endpoint to accept all notifications on all events, use "default" entity_type

Request

ROUTE
PUT /v1/account_endpoints/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "8"
}
BODY
{
  "client" : "new client",
  "endpoint_uri" : "http://example.com/new",
  "entity_type" : "Organization",
  "skip_origin" : false
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

287

BODY
{
  "account_endpoint" : {
    "id" : 8,
    "account_id" : 10,
    "client" : "new client",
    "entity_type" : "Organization",
    "endpoint_uri" : "http://example.com/new",
    "events" : null,
    "active" : true,
    "total_runs" : 0,
    "failures" : 0,
    "skip_origin" : false,
    "version" : "v1",
    "updated_by" : "account:e3cde693-dfe6-43cf-a194-d611f9908b6e"
  }
}

Account Account Endpoint

Account Endpoints API by Account

Resets counters and activates endpoint

Request

ROUTE
PATCH /v1/account_endpoints/:id/reset
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "7"
}
BODY
{}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

58

BODY
{
  "errors" : [
    "You are not authorized to access this page."
  ]
}

Reset endpoint

Resets counters and activates endpoint

Request

ROUTE
PATCH /v1/account_endpoints/:id/reset
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "5"
}
BODY
{}

Response

Account

Add organization to account

Creates Account Organization from given parameters

Parameters

Parameter Required Type Description
account_id required Integer Account ID
organization_id required Integer Organization ID
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity

Request

ROUTE
POST /v1/account_organizations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "account_id" : 13,
  "organization_id" : 6,
  "custom_fields" : {
    "key1" : "new value"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

258

BODY
{
  "account_organization" : {
    "id" : 1,
    "account_id" : 13,
    "organization_id" : 6,
    "custom_fields" : {
      "key1" : "new value"
    },
    "created_at" : "2016-02-09T16:06:52+0000",
    "updated_at" : "2016-02-09T16:06:52+0000",
    "version" : "v1",
    "updated_by" : "user:800990f0-1408-449a-a346-af8d3a3d371b"
  }
}

List organizations of account

Returns available Account Organizations

Request

ROUTE
GET /v1/account_organizations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

391

BODY
{
  "account_organizations" : [
    {
      "id" : 7,
      "account_id" : 17,
      "organization_id" : 14,
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:06:53+0000",
      "updated_at" : "2016-02-09T16:06:53+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 6,
      "account_id" : 16,
      "organization_id" : 13,
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:06:53+0000",
      "updated_at" : "2016-02-09T16:06:53+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Remove organization from account

Deletes Account Organization

Request

ROUTE
DELETE /v1/account_organizations/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "5"
}
BODY
{}

Response

Update properties of relation of Account and Organization

Updates given Account Organization with new parameters Account Organization

Parameters

Parameter Required Type Description
account_id optional Integer Account ID
organization_id optional Integer Organization ID
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity

Request

ROUTE
PATCH /v1/account_organizations/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "8"
}
BODY
{
  "custom_fields" : {
    "key2" : "new value"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

259

BODY
{
  "account_organization" : {
    "id" : 8,
    "account_id" : 18,
    "organization_id" : 16,
    "custom_fields" : {
      "key2" : "new value"
    },
    "created_at" : "2016-02-09T16:06:53+0000",
    "updated_at" : "2016-02-09T16:06:53+0000",
    "version" : "v1",
    "updated_by" : "user:29755140-bd4d-4fe5-a73f-3a4eb0fce69d"
  }
}

Create account

Request

ROUTE
POST /v1/accounts
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "name" : "new_name",
  "title" : "New Name",
  "phone_number" : "5551111111",
  "logo_token" : "f08fc7b7-9679-4c5d-a481-f809dc7877b1"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

359

BODY
{
  "account" : {
    "id" : 19,
    "uid" : "a1f912b4-6ef7-48f1-a03e-581d567ec3ac",
    "name" : "new_name",
    "title" : "New Name",
    "phone_number" : "+15551111111",
    "logo_token" : "f08fc7b7-9679-4c5d-a481-f809dc7877b1",
    "created_at" : "2016-02-09T16:06:53+0000",
    "updated_at" : "2016-02-09T16:06:53+0000",
    "organization_ids" : [],
    "version" : "v1",
    "updated_by" : "user:05046fb4-7023-4db6-885f-fa7476938cc8"
  }
}

List accounts

Request

ROUTE
GET /v1/accounts
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

648

BODY
{
  "accounts" : [
    {
      "id" : 22,
      "uid" : "ff5ef568-9f8b-4249-ae8a-db4358aefb1e",
      "name" : "account_22",
      "title" : "Account 22",
      "phone_number" : "+15555550022",
      "logo_token" : "72b939d1-eeb3-4f98-906e-09cd3b79e804",
      "created_at" : "2016-02-09T16:06:54+0000",
      "updated_at" : "2016-02-09T16:06:54+0000",
      "organization_ids" : [],
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 21,
      "uid" : "d7a4fcea-81f3-4af0-8cb4-47f2bd8b3ffe",
      "name" : "account_21",
      "title" : "Account 21",
      "phone_number" : "+15555550021",
      "logo_token" : "eaf22860-a08f-4ea2-86aa-72b56298945a",
      "created_at" : "2016-02-09T16:06:54+0000",
      "updated_at" : "2016-02-09T16:06:54+0000",
      "organization_ids" : [],
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Delete account

Request

ROUTE
DELETE /v1/accounts/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "20"
}
BODY
{}

Response

Update account

Request

ROUTE
PATCH /v1/accounts/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "23"
}
BODY
{
  "name" : "_____",
  "title" : "New Title",
  "logo_token" : "75756456-0fda-463f-a078-a8f82026894f"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

357

BODY
{
  "account" : {
    "id" : 23,
    "uid" : "d08a8004-cf05-4585-a314-3f521dad4dee",
    "name" : "apple",
    "title" : "New Title",
    "phone_number" : "+15555550023",
    "logo_token" : "75756456-0fda-463f-a078-a8f82026894f",
    "created_at" : "2016-02-09T16:06:54+0000",
    "updated_at" : "2016-02-09T16:06:54+0000",
    "organization_ids" : [],
    "version" : "v1",
    "updated_by" : "user:3a8c7fd6-6f0c-4f8d-97cb-f6fd4871bf0a"
  }
}

Address

Create address

Request

ROUTE
POST /v1/addresses
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "addressable_id" : 1,
  "addressable_type" : "Customer",
  "latitude" : 1.23,
  "longitude" : -3.45,
  "postal_code" : "02110",
  "city" : "Boston",
  "state" : "MA",
  "country" : "United States",
  "street_1" : "123 Summer St",
  "street_2" : "apt 5"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

379

BODY
{
  "address" : {
    "id" : 27,
    "addressable_id" : 1,
    "addressable_type" : "Customer",
    "street_1" : "123 Summer St",
    "street_2" : "apt 5",
    "postal_code" : "02110",
    "city" : "Boston",
    "state" : "MA",
    "country" : "United States",
    "latitude" : 1.23,
    "longitude" : -3.45,
    "created_at" : "2016-02-09T16:06:54+0000",
    "updated_at" : "2016-02-09T16:06:54+0000",
    "version" : "v1",
    "updated_by" : "user:1d3a4e5f-2b4c-4eb2-ac24-72c48e89641d"
  }
}

List addresses

Request

ROUTE
GET /v1/addresses
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "addressable_id_eq" : "6",
    "addressable_type_eq" : "Customer"
  },
  "sort" : "id asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

705

BODY
{
  "addresses" : [
    {
      "id" : 39,
      "addressable_id" : 6,
      "addressable_type" : "Customer",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:06:55+0000",
      "updated_at" : "2016-02-09T16:06:55+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 40,
      "addressable_id" : 6,
      "addressable_type" : "Customer",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:06:55+0000",
      "updated_at" : "2016-02-09T16:06:55+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Delete address

Request

ROUTE
DELETE /v1/addresses/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "32"
}
BODY
{}

Response

Update address

Request

ROUTE
PATCH /v1/addresses/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "43"
}
BODY
{
  "latitude" : 1.23,
  "longitude" : -3.45,
  "postal_code" : "02110",
  "city" : "Boston",
  "state" : "MA",
  "country" : "Canada",
  "street_1" : "123 Summer St",
  "street_2" : "apt 5"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

372

BODY
{
  "address" : {
    "id" : 43,
    "addressable_id" : 8,
    "addressable_type" : "Customer",
    "street_1" : "123 Summer St",
    "street_2" : "apt 5",
    "postal_code" : "02110",
    "city" : "Boston",
    "state" : "MA",
    "country" : "Canada",
    "latitude" : 1.23,
    "longitude" : -3.45,
    "created_at" : "2016-02-09T16:06:55+0000",
    "updated_at" : "2016-02-09T16:06:55+0000",
    "version" : "v1",
    "updated_by" : "user:0cb78196-56bb-4a52-bd6e-646ebde0e8e9"
  }
}

Application

Create client application

Creates an Application for a given set of parameters.

Parameters

Parameter Required Type Description
name required String Name of the application
redirect_uri required String The redirection endpoint URI MUST be
an absolute URI as defined by [RFC3986] section 4.3.
account_id optional Integer Account ID

Request

ROUTE
POST /v1/applications
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "name" : "new_name",
  "redirect_uri" : "https://example.com/callback",
  "account_id" : "1"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

405

BODY
{
  "application" : {
    "id" : 55,
    "uid" : "128a3b7b0f2d2c22b3be7b1dbcf3cdb5948428470cf93781005150dfa31b7559",
    "name" : "new_name",
    "secret" : "339bc495258b5d353848a1c9cdf0026268f6962f15d3d314cef747849b5d8b91",
    "redirect_uri" : "https://example.com/callback",
    "account_id" : 1,
    "created_at" : "2016-02-09T16:06:55+0000",
    "updated_at" : "2016-02-09T16:06:55+0000",
    "version" : "v1",
    "updated_by" : "user:ee70ab9d-8906-41dc-8310-dc87f48bcb5e"
  }
}

List applications

List of Applications.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/applications
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

714

BODY
{
  "applications" : [
    {
      "id" : 59,
      "uid" : "bbc6c00658dcfedb9e0b0e0bd3f4699bcab5b6ae87433a51b52e46bbaa1610aa",
      "name" : "main_33",
      "secret" : "7c990f123bb8d44502fb24bb737295b90a23a9fd0af51b7c78a6d2750961e74c",
      "redirect_uri" : "https://example.com",
      "account_id" : null,
      "created_at" : "2016-02-09T16:06:56+0000",
      "updated_at" : "2016-02-09T16:06:56+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 60,
      "uid" : "218984d93c4de8739c9323a264e14dec074b14b68aadc9a8e2f944f1120139e3",
      "name" : "main_34",
      "secret" : "f927d0ee36de54bf7c25bcfbbe5902b68a7edd9f247e293abbbfe74010cad5c8",
      "redirect_uri" : "https://example.com",
      "account_id" : null,
      "created_at" : "2016-02-09T16:06:56+0000",
      "updated_at" : "2016-02-09T16:06:56+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Update application

Update Application

Parameters

Parameter Required Type Description
account_id optional Integer Account ID
uid optional String UUID
secret optional String OAuth secret
name optional String Name
redirect_uri optional String OAuth redirect URL

Request

ROUTE
PATCH /v1/applications/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "61"
}
BODY
{
  "name" : "new name 2",
  "redirect_uri" : "https://example2.com",
  "account_id" : "2",
  "uid" : "1",
  "secret" : "secret"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

278

BODY
{
  "application" : {
    "id" : 61,
    "uid" : "1",
    "name" : "new name 2",
    "secret" : "secret",
    "redirect_uri" : "https://example2.com",
    "account_id" : 2,
    "created_at" : "2016-02-09T16:06:56+0000",
    "updated_at" : "2016-02-09T16:06:56+0000",
    "version" : "v1",
    "updated_by" : "user:1428dfd9-d328-48cd-82f4-7e51dc940ed3"
  }
}

Appointment

Create and schedule appointment

Creates an Appointment for a given set of parameters.

Parameters

Parameter Required Type Description
job_id required Integer ID of a job to create appointment for
user_id optional Integer ID of a technician to assign appointment to
parent_id optional Integer ID of a parent Appointment in scope of a Job
time required DateTime ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
duration required Integer Duration of appointment in seconds
strategy required String Indicates strategy how the appointment time and user were picked.
Possible values are: "manual", "automatic", "job_offer", or any other, default is "manual"
status required String Indicates status of an appointment
Possible values are: "draft", "scheduled", "enroute", "started", "paused", "complete", "canceled"

Request

ROUTE
POST /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "status" : "scheduled",
  "user_id" : 38,
  "job_id" : 1,
  "duration" : 2700,
  "time" : "2012-12-30T12:00:00+00:00",
  "title" : "New Title"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

925

BODY
{
  "appointment" : {
    "id" : 1,
    "parent_id" : null,
    "time" : "2012-12-30T12:00:00+0000",
    "status" : "scheduled",
    "duration" : 2700,
    "job_id" : 1,
    "user_id" : 38,
    "window_start_time" : null,
    "window_end_time" : null,
    "departed_at" : null,
    "started_at" : null,
    "complete_at" : null,
    "time_spent" : 0,
    "time_paid" : 0,
    "miles_driven" : 0.0,
    "miles_paid" : 0.0,
    "created_at" : "2012-12-30T08:00:00+0000",
    "updated_at" : "2012-12-30T08:00:00+0000",
    "title" : "New Title",
    "job_title" : "Job Title 1",
    "available_statuses" : [
      "enroute",
      "started",
      "canceled"
    ],
    "version" : "v1",
    "updated_by" : "user:a60e5a33-2d86-4db6-acca-5be7f885c938",
    "external_ids" : [],
    "address" : {
      "id" : 55,
      "addressable_id" : 1,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2012-12-30T08:00:00+0000",
      "updated_at" : "2012-12-30T08:00:00+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  }
}

Create draft appointment

Creates an Appointment for a given set of parameters.

Parameters

Parameter Required Type Description
job_id required Integer ID of a job to create appointment for
user_id optional Integer ID of a technician to assign appointment to
parent_id optional Integer ID of a parent Appointment in scope of a Job
time required DateTime ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
duration required Integer Duration of appointment in seconds
strategy required String Indicates strategy how the appointment time and user were picked.
Possible values are: "manual", "automatic", "job_offer", or any other, default is "manual"
status required String Indicates status of an appointment
Possible values are: "draft", "scheduled", "enroute", "started", "paused", "complete", "canceled"

Request

ROUTE
POST /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "job_id" : 2,
  "duration" : 2700,
  "time" : "2012-12-30T12:00:00+00:00"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

908

BODY
{
  "appointment" : {
    "id" : 2,
    "parent_id" : null,
    "time" : "2012-12-30T12:00:00+0000",
    "status" : "draft",
    "duration" : 2700,
    "job_id" : 2,
    "user_id" : null,
    "window_start_time" : null,
    "window_end_time" : null,
    "departed_at" : null,
    "started_at" : null,
    "complete_at" : null,
    "time_spent" : 0,
    "time_paid" : 0,
    "miles_driven" : 0.0,
    "miles_paid" : 0.0,
    "created_at" : "2012-12-30T08:00:00+0000",
    "updated_at" : "2012-12-30T08:00:00+0000",
    "title" : null,
    "job_title" : "Job Title 2",
    "available_statuses" : [
      "scheduled",
      "canceled"
    ],
    "version" : "v1",
    "updated_by" : "user:a235b4e2-7ae3-42ea-996e-ec02771ae059",
    "external_ids" : [],
    "address" : {
      "id" : 60,
      "addressable_id" : 2,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2012-12-30T08:00:00+0000",
      "updated_at" : "2012-12-30T08:00:00+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  }
}

Filter by one or multiple jobs

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "job_id_in" : [
      "29",
      "28"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1752

BODY
{
  "appointments" : [
    {
      "id" : 23,
      "parent_id" : null,
      "time" : "2016-02-09T17:07:03+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 29,
      "user_id" : 80,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:03+0000",
      "updated_at" : "2016-02-09T16:07:03+0000",
      "title" : "Title 18",
      "job_title" : "Job Title 29",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 184,
        "addressable_id" : 29,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:03+0000",
        "updated_at" : "2016-02-09T16:07:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 24,
      "parent_id" : null,
      "time" : "2016-02-09T18:07:03+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 28,
      "user_id" : 81,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:03+0000",
      "updated_at" : "2016-02-09T16:07:03+0000",
      "title" : "Title 19",
      "job_title" : "Job Title 28",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 181,
        "addressable_id" : 28,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:03+0000",
        "updated_at" : "2016-02-09T16:07:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Filter by one or multiple statuses

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "status_in" : [
      "started",
      "enroute"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1763

BODY
{
  "appointments" : [
    {
      "id" : 39,
      "parent_id" : null,
      "time" : "2016-02-09T17:07:05+0000",
      "status" : "started",
      "duration" : 3600,
      "job_id" : 35,
      "user_id" : 99,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:05+0000",
      "updated_at" : "2016-02-09T16:07:05+0000",
      "title" : "Title 34",
      "job_title" : "Job Title 35",
      "available_statuses" : [
        "complete",
        "paused",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 222,
        "addressable_id" : 35,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:04+0000",
        "updated_at" : "2016-02-09T16:07:05+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 40,
      "parent_id" : null,
      "time" : "2016-02-09T18:07:05+0000",
      "status" : "enroute",
      "duration" : 3600,
      "job_id" : 35,
      "user_id" : 100,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:05+0000",
      "updated_at" : "2016-02-09T16:07:05+0000",
      "title" : "Title 35",
      "job_title" : "Job Title 35",
      "available_statuses" : [
        "started",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 222,
        "addressable_id" : 35,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:04+0000",
        "updated_at" : "2016-02-09T16:07:05+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Filter by one or multiple users

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "user_id_in" : [
      "86",
      "88"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1752

BODY
{
  "appointments" : [
    {
      "id" : 29,
      "parent_id" : null,
      "time" : "2016-02-09T17:07:03+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 32,
      "user_id" : 86,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:03+0000",
      "updated_at" : "2016-02-09T16:07:03+0000",
      "title" : "Title 24",
      "job_title" : "Job Title 32",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 200,
        "addressable_id" : 32,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:03+0000",
        "updated_at" : "2016-02-09T16:07:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 30,
      "parent_id" : null,
      "time" : "2016-02-09T18:07:04+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 32,
      "user_id" : 88,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:04+0000",
      "updated_at" : "2016-02-09T16:07:04+0000",
      "title" : "Title 25",
      "job_title" : "Job Title 32",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 200,
        "addressable_id" : 32,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:03+0000",
        "updated_at" : "2016-02-09T16:07:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Filter by time span

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "time_gteq" : "2017-12-31 00:30:00 UTC",
    "time_lteq" : "2017-12-31 02:30:00 UTC"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1752

BODY
{
  "appointments" : [
    {
      "id" : 33,
      "parent_id" : null,
      "time" : "2017-12-31T01:00:00+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 33,
      "user_id" : 91,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:04+0000",
      "updated_at" : "2016-02-09T16:07:04+0000",
      "title" : "Title 28",
      "job_title" : "Job Title 33",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 207,
        "addressable_id" : 33,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:04+0000",
        "updated_at" : "2016-02-09T16:07:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 34,
      "parent_id" : null,
      "time" : "2017-12-31T02:00:00+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 33,
      "user_id" : 92,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:04+0000",
      "updated_at" : "2016-02-09T16:07:04+0000",
      "title" : "Title 29",
      "job_title" : "Job Title 33",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 207,
        "addressable_id" : 33,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:04+0000",
        "updated_at" : "2016-02-09T16:07:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Filter with unpaid labor

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_appointment_unpaid_labor" : "true"
  },
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1718

BODY
{
  "appointments" : [
    {
      "id" : 43,
      "parent_id" : null,
      "time" : "2013-01-01T08:00:00+0000",
      "status" : "complete",
      "duration" : 3600,
      "job_id" : 36,
      "user_id" : 104,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 10,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2012-12-30T08:00:00+0000",
      "updated_at" : "2012-12-30T08:00:00+0000",
      "title" : "Title 38",
      "job_title" : "Job Title 36",
      "available_statuses" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 229,
        "addressable_id" : 36,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2012-12-30T08:00:00+0000",
        "updated_at" : "2012-12-30T08:00:00+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 42,
      "parent_id" : null,
      "time" : "2013-01-01T08:00:00+0000",
      "status" : "complete",
      "duration" : 3600,
      "job_id" : 36,
      "user_id" : 103,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 10,
      "time_paid" : 5,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2012-12-30T08:00:00+0000",
      "updated_at" : "2012-12-30T08:00:00+0000",
      "title" : "Title 37",
      "job_title" : "Job Title 36",
      "available_statuses" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 229,
        "addressable_id" : 36,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2012-12-30T08:00:00+0000",
        "updated_at" : "2012-12-30T08:00:00+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Filter with unpaid miles

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_appointment_unpaid_miles" : "true"
  },
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1718

BODY
{
  "appointments" : [
    {
      "id" : 48,
      "parent_id" : null,
      "time" : "2013-01-01T08:00:00+0000",
      "status" : "complete",
      "duration" : 3600,
      "job_id" : 37,
      "user_id" : 109,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 10.0,
      "miles_paid" : 0.0,
      "created_at" : "2012-12-30T08:00:00+0000",
      "updated_at" : "2012-12-30T08:00:00+0000",
      "title" : "Title 43",
      "job_title" : "Job Title 37",
      "available_statuses" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 237,
        "addressable_id" : 37,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2012-12-30T08:00:00+0000",
        "updated_at" : "2012-12-30T08:00:00+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 47,
      "parent_id" : null,
      "time" : "2013-01-01T08:00:00+0000",
      "status" : "complete",
      "duration" : 3600,
      "job_id" : 37,
      "user_id" : 108,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 10.0,
      "miles_paid" : 5.0,
      "created_at" : "2012-12-30T08:00:00+0000",
      "updated_at" : "2012-12-30T08:00:00+0000",
      "title" : "Title 42",
      "job_title" : "Job Title 37",
      "available_statuses" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 237,
        "addressable_id" : 37,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2012-12-30T08:00:00+0000",
        "updated_at" : "2012-12-30T08:00:00+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

List appointments

List of Appointments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_appointment_unpaid_labor]=true Returns all the appointments which has unpaid labor
- filter[by_appointment_unpaid_miles]=true Returns all the appointments which has unpaid miles
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/appointments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1749

BODY
{
  "appointments" : [
    {
      "id" : 9,
      "parent_id" : null,
      "time" : "2016-02-09T17:07:01+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 20,
      "user_id" : 62,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:01+0000",
      "updated_at" : "2016-02-09T16:07:01+0000",
      "title" : "Title 4",
      "job_title" : "Job Title 20",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 139,
        "addressable_id" : 20,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:01+0000",
        "updated_at" : "2016-02-09T16:07:01+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    },
    {
      "id" : 10,
      "parent_id" : null,
      "time" : "2016-02-09T18:07:01+0000",
      "status" : "draft",
      "duration" : 3600,
      "job_id" : 20,
      "user_id" : 63,
      "window_start_time" : null,
      "window_end_time" : null,
      "departed_at" : null,
      "started_at" : null,
      "complete_at" : null,
      "time_spent" : 0,
      "time_paid" : 0,
      "miles_driven" : 0.0,
      "miles_paid" : 0.0,
      "created_at" : "2016-02-09T16:07:01+0000",
      "updated_at" : "2016-02-09T16:07:01+0000",
      "title" : "Title 5",
      "job_title" : "Job Title 20",
      "available_statuses" : [
        "scheduled",
        "canceled"
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 139,
        "addressable_id" : 20,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:01+0000",
        "updated_at" : "2016-02-09T16:07:01+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Delete appointment

Deletes an Appointment if the appointment is in scheduled or draft status.

Request

ROUTE
DELETE /v1/appointments/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "6"
}
BODY
{}

Response

Update appointment

Updates an Appointments for a given set of parameters.

Parameters

Parameter Required Type Description
time required DateTime ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
duration required Integer Duration of appointment in seconds
strategy required String Indicates strategy how the appointment time and user were picked.
Possible values are: "manual", "automatic", "job_offer", or any other, default is "manual"
status required String Indicates status of an appointment
Possible values are: "draft", "scheduled", "enroute", "started", "paused", "complete", "canceled"

Request

ROUTE
PATCH /v1/appointments/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "64"
}
BODY
{
  "status" : "scheduled",
  "user_id" : 129
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

930

BODY
{
  "appointment" : {
    "id" : 64,
    "parent_id" : null,
    "time" : "2016-02-11T16:07:08+0000",
    "status" : "scheduled",
    "duration" : 3600,
    "job_id" : 45,
    "user_id" : 129,
    "window_start_time" : null,
    "window_end_time" : null,
    "departed_at" : null,
    "started_at" : null,
    "complete_at" : null,
    "time_spent" : 0,
    "time_paid" : 0,
    "miles_driven" : 0.0,
    "miles_paid" : 0.0,
    "created_at" : "2016-02-09T16:07:08+0000",
    "updated_at" : "2016-02-09T16:07:08+0000",
    "title" : "Title 59",
    "job_title" : "Job Title 45",
    "available_statuses" : [
      "enroute",
      "started",
      "canceled"
    ],
    "version" : "v1",
    "updated_by" : "user:a3062b4b-efe4-4ffa-a382-185c9e930f63",
    "external_ids" : [],
    "address" : {
      "id" : 282,
      "addressable_id" : 45,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:07:08+0000",
      "updated_at" : "2016-02-09T16:07:08+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  }
}

Notify appointment

Sends given notification to specified appointment

Parameters

Parameter Required Type Description
event_action required String Actions that can be sent.
Current available actions: rescheduled

Request

ROUTE
PATCH /v1/appointments/:id/notify
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "60"
}
BODY
{
  "event_action" : "rescheduled"
}

Response

Notify appointment

Sends given notification to specified appointment

Parameters

Parameter Required Type Description
event_action required String Actions that can be sent.
Current available actions: rescheduled

Request

ROUTE
PATCH /v1/appointments/:id/notify
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "61"
}
BODY
{
  "event_action" : "scheduled"
}

Response

Attachment

Create attachment

Creates an Attachment for a given set of parameters.

Parameters

Parameter Required Type Description
entity_id required Integer ID of the entity attachment will be created for
entity_type required String Type of the entity attachment will be created for (i.e. "Job")
file_token required String File Token (UUID)
name optional String Attachment Name
description required String Attachment Description

Request

ROUTE
POST /v1/attachments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "entity_id" : 66,
  "entity_type" : "Job",
  "file_token" : "c7a33a76-18ad-49c9-bc4d-1f6ae8196ab1",
  "name" : "File Name",
  "description" : "File Description"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

332

BODY
{
  "attachment" : {
    "id" : 1,
    "entity_type" : "Job",
    "entity_id" : 66,
    "file_token" : "c7a33a76-18ad-49c9-bc4d-1f6ae8196ab1",
    "name" : "File Name",
    "description" : "File Description",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:07:15+0000",
    "updated_at" : "2016-02-09T16:07:15+0000",
    "version" : "v1",
    "updated_by" : "user:52cbe9b1-ab45-4dd8-9e1d-381d543e6aeb"
  }
}

List attachments

List of Attachments for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
filter[entity_type_eq]=Job&filter[entity_id_eq]=123 will retrieve attachments of given Job

Request

ROUTE
GET /v1/attachments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

565

BODY
{
  "attachments" : [
    {
      "id" : 5,
      "entity_type" : "Job",
      "entity_id" : 70,
      "file_token" : "af8d5c63-a798-425e-bb54-36751677fcf3",
      "name" : "234",
      "description" : "Description 4",
      "external_ids" : [],
      "created_at" : "2016-02-09T16:07:16+0000",
      "updated_at" : "2016-02-09T16:07:16+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 4,
      "entity_type" : "Job",
      "entity_id" : 70,
      "file_token" : "7d23e4a9-9532-4bca-bd93-935fff680bbd",
      "name" : "123",
      "description" : "Description 3",
      "external_ids" : [],
      "created_at" : "2016-02-09T16:07:16+0000",
      "updated_at" : "2016-02-09T16:07:16+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Delete attachment

Deletes an Attachment

Request

ROUTE
DELETE /v1/attachments/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "2"
}
BODY
{}

Response

Update attachment

Updates an Attachment for a given set of parameters.

Parameters

Parameter Required Type Description
entity_id required Integer ID of the entity attachment will be created for
entity_type required String Type of the entity attachment will be created for
"Job"
file_token required String File Token (UUID)
name optional String Attachment Name
description required String Attachment Description

Request

ROUTE
PATCH /v1/attachments/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "18"
}
BODY
{
  "file_token" : "3028d0cc-a63f-493f-93df-6f071657e262",
  "name" : "New Name",
  "description" : "New Description"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

331

BODY
{
  "attachment" : {
    "id" : 18,
    "entity_type" : "Job",
    "entity_id" : 78,
    "file_token" : "3028d0cc-a63f-493f-93df-6f071657e262",
    "name" : "New Name",
    "description" : "New Description",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:07:17+0000",
    "updated_at" : "2016-02-09T16:07:17+0000",
    "version" : "v1",
    "updated_by" : "user:c67e0a14-f09b-4160-87a9-7efe3985caf1"
  }
}

Billing Document

Create Estimate

Creates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
job_id required Integer Invoice will be attached to a given Job ID
doc_type required String Type of the Billing Document: Invoice or Estimate
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
lines optional Lines should be provided always in full.
Important! No partial updates allowed.
lines[][id] required String UUID for line item
lines[][category] required String Type of a billing document line: labor, part, miles or adjustment
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional Float Tax % for the line item
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed

Request

ROUTE
POST /v1/billing_documents
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 141,
  "job_id" : 86,
  "doc_type" : "Estimate",
  "description" : "Toilet flooding",
  "due_date" : "2016-02-23T16:07:20+0000",
  "address" : {
    "addressable_type" : "Organization",
    "postal_code" : "02110",
    "city" : "Boston",
    "state" : "MA",
    "country" : "United States",
    "street_1" : "123 Summer St",
    "street_2" : "apt 5"
  },
  "discount_amount" : "1234",
  "discount_percent" : 0.25,
  "lines" : [
    {
      "trade_quote_id" : 6,
      "title" : "test",
      "category" : "part",
      "description" : "pipes",
      "qty" : 10,
      "price" : 2.2
    },
    {
      "category" : "miles",
      "description" : "drive to client and back",
      "qty" : 8,
      "price" : 1.2
    },
    {
      "category" : "labor",
      "description" : "expect 1h labor",
      "qty" : 1,
      "price" : 200
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2410

BODY
{
  "billing_document" : {
    "id" : 5,
    "status" : "draft",
    "doc_type" : "Estimate",
    "number" : "16020986",
    "job_id" : 86,
    "organization_id" : 141,
    "title" : null,
    "description" : "Toilet flooding",
    "discount_amount" : {
      "value" : "1234.00",
      "currency" : "USD",
      "text" : "$1,234.00"
    },
    "discount_percent" : "0.25",
    "paid" : false,
    "subtotal" : {
      "value" : "231.60",
      "currency" : "USD",
      "text" : "$231.60"
    },
    "tax_amount" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "total" : {
      "value" : "-1002.40",
      "currency" : "USD",
      "text" : "$-1,002.40"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2016-02-09T16:07:20+0000",
    "updated_at" : "2016-02-09T16:07:20+0000",
    "signature" : null,
    "skipped_signature" : false,
    "signed_at" : null,
    "invoice_id" : null,
    "attachment_id" : null,
    "job_title" : "Job Title 86",
    "customer_full_name" : "John-95 Doe-95",
    "version" : "v1",
    "updated_by" : "user:3af076ce-825a-4539-a7b6-2581f221e9a6",
    "external_ids" : [],
    "address" : {
      "id" : 493,
      "addressable_id" : 5,
      "addressable_type" : "BillingDocument",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:07:20+0000",
      "updated_at" : "2016-02-09T16:07:20+0000",
      "version" : "v1",
      "updated_by" : "user:3af076ce-825a-4539-a7b6-2581f221e9a6"
    },
    "lines" : [
      {
        "id" : "be3c7522-1664-4de3-9851-f32aa9fa56db",
        "appointment_id" : null,
        "title" : "test",
        "line_item_type_id" : null,
        "qty" : 10.0,
        "category" : "part",
        "description" : "pipes",
        "price" : {
          "value" : "2.20",
          "currency" : "USD",
          "text" : "$2.20"
        },
        "price_with_markup" : {
          "value" : "2.20",
          "currency" : "USD",
          "text" : "$2.20"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "22.00",
          "currency" : "USD",
          "text" : "$22.00"
        }
      },
      {
        "id" : "515fe04a-5ad1-4c9c-b1a4-84ecb2f3efdf",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 8.0,
        "category" : "miles",
        "description" : "drive to client and back",
        "price" : {
          "value" : "1.20",
          "currency" : "USD",
          "text" : "$1.20"
        },
        "price_with_markup" : {
          "value" : "1.20",
          "currency" : "USD",
          "text" : "$1.20"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "9.60",
          "currency" : "USD",
          "text" : "$9.60"
        }
      },
      {
        "id" : "d382bca3-6c4d-4222-babf-e3e642c023cf",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 1.0,
        "category" : "labor",
        "description" : "expect 1h labor",
        "price" : {
          "value" : "200.00",
          "currency" : "USD",
          "text" : "$200.00"
        },
        "price_with_markup" : {
          "value" : "200.00",
          "currency" : "USD",
          "text" : "$200.00"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "200.00",
          "currency" : "USD",
          "text" : "$200.00"
        }
      }
    ]
  }
}

Create Invoice

Creates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
job_id required Integer Invoice will be attached to a given Job ID
doc_type required String Type of the Billing Document: Invoice or Estimate
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
lines optional Lines should be provided always in full.
Important! No partial updates allowed.
lines[][id] required String UUID for line item
lines[][category] required String Type of a billing document line: labor, part, miles or adjustment
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional Float Tax % for the line item
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed

Request

ROUTE
POST /v1/billing_documents
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 136,
  "job_id" : 81,
  "doc_type" : "Invoice",
  "description" : "Toilet flooding",
  "due_date" : "2016-02-23T16:07:18+0000",
  "address" : {
    "addressable_type" : "BillingDocument",
    "postal_code" : "02110",
    "city" : "Boston",
    "state" : "MA",
    "country" : "United States",
    "street_1" : "123 Summer St",
    "street_2" : "apt 5"
  },
  "discount_amount" : "1234",
  "discount_percent" : 0.25,
  "lines" : [
    {
      "trade_quote_id" : 1,
      "title" : "test",
      "category" : "part",
      "description" : "pipes",
      "qty" : 10,
      "price" : 2.2
    },
    {
      "category" : "miles",
      "description" : "drive to client and back",
      "qty" : 8,
      "price" : 1.2
    },
    {
      "category" : "labor",
      "description" : "expect 1h labor",
      "qty" : 1,
      "price" : 200
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2447

BODY
{
  "billing_document" : {
    "id" : 1,
    "status" : "draft",
    "doc_type" : "Invoice",
    "number" : "16020981",
    "job_id" : 81,
    "organization_id" : 136,
    "title" : null,
    "description" : "Toilet flooding",
    "due_date" : "2016-02-23",
    "discount_amount" : {
      "value" : "1234.00",
      "currency" : "USD",
      "text" : "$1,234.00"
    },
    "discount_percent" : "0.25",
    "paid" : false,
    "subtotal" : {
      "value" : "231.60",
      "currency" : "USD",
      "text" : "$231.60"
    },
    "tax_amount" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "total" : {
      "value" : "-1002.40",
      "currency" : "USD",
      "text" : "$-1,002.40"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2016-02-09T16:07:18+0000",
    "updated_at" : "2016-02-09T16:07:18+0000",
    "signature" : null,
    "skipped_signature" : false,
    "signed_at" : null,
    "invoice_id" : null,
    "attachment_id" : null,
    "job_title" : "Job Title 81",
    "customer_full_name" : "John-90 Doe-90",
    "version" : "v1",
    "updated_by" : "user:bdb6aa32-4d89-40d6-898e-948cfb970d6f",
    "external_ids" : [],
    "address" : {
      "id" : 464,
      "addressable_id" : 1,
      "addressable_type" : "BillingDocument",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:07:18+0000",
      "updated_at" : "2016-02-09T16:07:18+0000",
      "version" : "v1",
      "updated_by" : "user:bdb6aa32-4d89-40d6-898e-948cfb970d6f"
    },
    "payments" : [],
    "lines" : [
      {
        "id" : "7314d495-21d5-4227-b005-26e9091e4bb8",
        "appointment_id" : null,
        "title" : "test",
        "line_item_type_id" : null,
        "qty" : 10.0,
        "category" : "part",
        "description" : "pipes",
        "price" : {
          "value" : "2.20",
          "currency" : "USD",
          "text" : "$2.20"
        },
        "price_with_markup" : {
          "value" : "2.20",
          "currency" : "USD",
          "text" : "$2.20"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "22.00",
          "currency" : "USD",
          "text" : "$22.00"
        }
      },
      {
        "id" : "19b88d12-385c-4028-a7d8-c628fc178e4f",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 8.0,
        "category" : "miles",
        "description" : "drive to client and back",
        "price" : {
          "value" : "1.20",
          "currency" : "USD",
          "text" : "$1.20"
        },
        "price_with_markup" : {
          "value" : "1.20",
          "currency" : "USD",
          "text" : "$1.20"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "9.60",
          "currency" : "USD",
          "text" : "$9.60"
        }
      },
      {
        "id" : "af521adc-aa96-439c-a964-e14cf234d799",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 1.0,
        "category" : "labor",
        "description" : "expect 1h labor",
        "price" : {
          "value" : "200.00",
          "currency" : "USD",
          "text" : "$200.00"
        },
        "price_with_markup" : {
          "value" : "200.00",
          "currency" : "USD",
          "text" : "$200.00"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "200.00",
          "currency" : "USD",
          "text" : "$200.00"
        }
      }
    ]
  }
}

List billing documents

List of Billing Documents for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v1/billing_documents
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2384

BODY
{
  "billing_documents" : [
    {
      "id" : 10,
      "status" : "draft",
      "doc_type" : "Estimate",
      "number" : "16020991",
      "job_id" : 91,
      "organization_id" : 146,
      "title" : null,
      "description" : "Billing 2",
      "discount_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "discount_percent" : null,
      "paid" : false,
      "subtotal" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "tax_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total_paid" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "created_at" : "2016-02-09T16:07:21+0000",
      "updated_at" : "2016-02-09T16:07:21+0000",
      "signature" : null,
      "skipped_signature" : false,
      "signed_at" : null,
      "invoice_id" : null,
      "attachment_id" : null,
      "job_title" : "Job Title 91",
      "customer_full_name" : "John-100 Doe-100",
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 522,
        "addressable_id" : 10,
        "addressable_type" : "BillingDocument",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:21+0000",
        "updated_at" : "2016-02-09T16:07:21+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "lines" : []
    },
    {
      "id" : 9,
      "status" : "draft",
      "doc_type" : "Invoice",
      "number" : "16020991",
      "job_id" : 91,
      "organization_id" : 146,
      "title" : null,
      "description" : "Billing 1",
      "due_date" : "2016-02-23",
      "discount_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "discount_percent" : null,
      "paid" : false,
      "subtotal" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "tax_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total_paid" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "created_at" : "2016-02-09T16:07:21+0000",
      "updated_at" : "2016-02-09T16:07:21+0000",
      "signature" : null,
      "skipped_signature" : false,
      "signed_at" : null,
      "invoice_id" : null,
      "attachment_id" : null,
      "job_title" : "Job Title 91",
      "customer_full_name" : "John-100 Doe-100",
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 521,
        "addressable_id" : 9,
        "addressable_type" : "BillingDocument",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:21+0000",
        "updated_at" : "2016-02-09T16:07:21+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "payments" : [],
      "lines" : []
    }
  ]
}

Update Estimate

Updates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
signature required Bytes base64 encoded signature of customer.
Required if document is not 'draft' or 'lost' unless skipped_signature is set to true
skipped_signature optional Boolean If customer chooses not to sign document
status optional String Status of Billing Docment. Default value is draft.
For Estimate valid statuses are: draft, sent, won and lost
For Invoice valid statuses are: draft, sent, paid and balance_outstanding
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
lines optional Lines should be provided always in full. No partial updates allowed.
lines[][id] required String UUID for line item
lines[][category] required String Type of a billing document line: labor, part, miles or adjustment
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional Float Tax % for the line item
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed (if id is given)
signature optional String Signature text

Request

ROUTE
PATCH /v1/billing_documents/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "55"
}
BODY
{
  "description" : "New description",
  "due_date" : "2014-12-31T12:00:00+0000",
  "address" : {
    "street_1" : "123 Summer St"
  },
  "signature" : "this is my signature",
  "discount_amount" : 10.0,
  "lines" : [
    {
      "id" : "234b8ca3-dabc-44e7-a17a-9a2781b693db",
      "title" : null,
      "line_item_type_id" : null,
      "appointment_id" : null,
      "markup" : 0.0,
      "tax" : 0.0,
      "qty" : "12.37",
      "category" : "labor",
      "description" : "Lorem dolorem",
      "price_cents" : 1022,
      "price_currency" : "USD",
      "_destroy" : false
    },
    {
      "id" : "4558dca4-b9ce-4692-8b4c-10498de7d888",
      "title" : null,
      "line_item_type_id" : null,
      "appointment_id" : null,
      "markup" : 0.0,
      "tax" : 0.0,
      "qty" : 1.5,
      "category" : "labor",
      "description" : "Lorem dolorem",
      "price_cents" : 1022,
      "price_currency" : "USD",
      "_destroy" : true
    },
    {
      "category" : "adjustment",
      "description" : "discount",
      "price" : -1.0
    },
    {
      "category" : "part",
      "description" : "some pipe",
      "qty" : 1.13,
      "price" : 7.77
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2422

BODY
{
  "billing_document" : {
    "id" : 55,
    "status" : "draft",
    "doc_type" : "Estimate",
    "number" : "141229117",
    "job_id" : 117,
    "organization_id" : 171,
    "title" : null,
    "description" : "New description",
    "discount_amount" : {
      "value" : "10.00",
      "currency" : "USD",
      "text" : "$10.00"
    },
    "discount_percent" : null,
    "paid" : false,
    "subtotal" : {
      "value" : "7.78",
      "currency" : "USD",
      "text" : "$7.78"
    },
    "tax_amount" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "total" : {
      "value" : "-2.22",
      "currency" : "USD",
      "text" : "$-2.22"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2014-12-29T12:00:00+0000",
    "updated_at" : "2014-12-29T12:00:00+0000",
    "signature" : "this is my signature",
    "skipped_signature" : false,
    "signed_at" : "2014-12-29T12:00:00+0000",
    "invoice_id" : null,
    "attachment_id" : null,
    "job_title" : "Job Title 117",
    "customer_full_name" : "John-126 Doe-126",
    "version" : "v1",
    "updated_by" : "user:b91729d5-96e4-4686-ab35-318b4fbb6cee",
    "external_ids" : [],
    "address" : {
      "id" : 674,
      "addressable_id" : 55,
      "addressable_type" : "BillingDocument",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2014-12-29T12:00:00+0000",
      "updated_at" : "2014-12-29T12:00:00+0000",
      "version" : "v1",
      "updated_by" : "user:b91729d5-96e4-4686-ab35-318b4fbb6cee"
    },
    "lines" : [
      {
        "id" : "234b8ca3-dabc-44e7-a17a-9a2781b693db",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 12.37,
        "category" : "labor",
        "description" : "Lorem dolorem",
        "price" : {
          "value" : "0.00",
          "currency" : "USD",
          "text" : "$0.00"
        },
        "price_with_markup" : {
          "value" : "0.00",
          "currency" : "USD",
          "text" : "$0.00"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "0.00",
          "currency" : "USD",
          "text" : "$0.00"
        }
      },
      {
        "id" : "eca6013e-1260-44b7-abd3-1ac6a32b5c19",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 1.0,
        "category" : "adjustment",
        "description" : "discount",
        "price" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "price_with_markup" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        }
      },
      {
        "id" : "08ff0962-58e9-4ab8-ab68-883f437a5184",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 1.13,
        "category" : "part",
        "description" : "some pipe",
        "price" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "price_with_markup" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "8.78",
          "currency" : "USD",
          "text" : "$8.78"
        }
      }
    ]
  }
}

Update Invoice

Updates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
signature required Bytes base64 encoded signature of customer.
Required if document is not 'draft' or 'lost' unless skipped_signature is set to true
skipped_signature optional Boolean If customer chooses not to sign document
status optional String Status of Billing Docment. Default value is draft.
For Estimate valid statuses are: draft, sent, won and lost
For Invoice valid statuses are: draft, sent, paid and balance_outstanding
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
lines optional Lines should be provided always in full. No partial updates allowed.
lines[][id] required String UUID for line item
lines[][category] required String Type of a billing document line: labor, part, miles or adjustment
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional Float Tax % for the line item
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed (if id is given)
signature optional String Signature text

Request

ROUTE
PATCH /v1/billing_documents/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "49"
}
BODY
{
  "description" : "New description",
  "due_date" : "2014-12-31T12:00:00+0000",
  "address" : {
    "street_1" : "123 Summer St"
  },
  "signature" : "this is my signature",
  "discount_amount" : 10.0,
  "lines" : [
    {
      "id" : "2dabee62-0b72-4bf8-9b0e-6797409aba27",
      "title" : null,
      "line_item_type_id" : null,
      "appointment_id" : null,
      "markup" : 0.0,
      "tax" : 0.0,
      "qty" : "12.37",
      "category" : "labor",
      "description" : "Lorem dolorem",
      "price_cents" : 1022,
      "price_currency" : "USD",
      "_destroy" : false
    },
    {
      "id" : "a2d98de0-0794-4155-b968-305a670283cd",
      "title" : null,
      "line_item_type_id" : null,
      "appointment_id" : null,
      "markup" : 0.0,
      "tax" : 0.0,
      "qty" : 1.5,
      "category" : "labor",
      "description" : "Lorem dolorem",
      "price_cents" : 1022,
      "price_currency" : "USD",
      "_destroy" : true
    },
    {
      "category" : "adjustment",
      "description" : "discount",
      "price" : -1.0
    },
    {
      "category" : "part",
      "description" : "some pipe",
      "qty" : 1.13,
      "price" : 7.77
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2459

BODY
{
  "billing_document" : {
    "id" : 49,
    "status" : "draft",
    "doc_type" : "Invoice",
    "number" : "141229111",
    "job_id" : 111,
    "organization_id" : 165,
    "title" : null,
    "description" : "New description",
    "due_date" : "2014-12-31",
    "discount_amount" : {
      "value" : "10.00",
      "currency" : "USD",
      "text" : "$10.00"
    },
    "discount_percent" : null,
    "paid" : false,
    "subtotal" : {
      "value" : "7.78",
      "currency" : "USD",
      "text" : "$7.78"
    },
    "tax_amount" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "total" : {
      "value" : "-2.22",
      "currency" : "USD",
      "text" : "$-2.22"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2014-12-29T12:00:00+0000",
    "updated_at" : "2014-12-29T12:00:00+0000",
    "signature" : "this is my signature",
    "skipped_signature" : false,
    "signed_at" : "2014-12-29T12:00:00+0000",
    "invoice_id" : null,
    "attachment_id" : null,
    "job_title" : "Job Title 111",
    "customer_full_name" : "John-120 Doe-120",
    "version" : "v1",
    "updated_by" : "user:240f909d-6caa-4b93-ad5e-ca4b7bf63387",
    "external_ids" : [],
    "address" : {
      "id" : 644,
      "addressable_id" : 49,
      "addressable_type" : "BillingDocument",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2014-12-29T12:00:00+0000",
      "updated_at" : "2014-12-29T12:00:00+0000",
      "version" : "v1",
      "updated_by" : "user:240f909d-6caa-4b93-ad5e-ca4b7bf63387"
    },
    "payments" : [],
    "lines" : [
      {
        "id" : "2dabee62-0b72-4bf8-9b0e-6797409aba27",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 12.37,
        "category" : "labor",
        "description" : "Lorem dolorem",
        "price" : {
          "value" : "0.00",
          "currency" : "USD",
          "text" : "$0.00"
        },
        "price_with_markup" : {
          "value" : "0.00",
          "currency" : "USD",
          "text" : "$0.00"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "0.00",
          "currency" : "USD",
          "text" : "$0.00"
        }
      },
      {
        "id" : "62b51f8d-1962-45df-b347-76a970be3053",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 1.0,
        "category" : "adjustment",
        "description" : "discount",
        "price" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "price_with_markup" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        }
      },
      {
        "id" : "b667847c-f56e-4ce1-928d-6891ab827e95",
        "appointment_id" : null,
        "title" : null,
        "line_item_type_id" : null,
        "qty" : 1.13,
        "category" : "part",
        "description" : "some pipe",
        "price" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "price_with_markup" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "markup" : 0.0,
        "tax" : 0.0,
        "total" : {
          "value" : "8.78",
          "currency" : "USD",
          "text" : "$8.78"
        }
      }
    ]
  }
}

Send estimate to the customer

Sends a Billing Document to a given email address

Parameters

Parameter Required Type Description
email optional String Recipient's Email address, overriding existing customer email address

Request

ROUTE
POST /v1/billing_documents/:id/send_by_email
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "47"
}
BODY
{
  "email" : "send_email@example.com"
}

Response

Send invoice to the customer

Sends a Billing Document to a given email address

Parameters

Parameter Required Type Description
email optional String Recipient's Email address, overriding existing customer email address

Request

ROUTE
POST /v1/billing_documents/:id/send_by_email
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "44"
}
BODY
{
  "email" : "send_email@example.com"
}

Response

Brand

Create brand

Creates a Brand for a given set of parameters.

Parameters

Parameter Required Type Description
name required String Name of Brand
email required String Brand's email address
phone_number required String Brand's phone number
logo_token required UUID Logo token (UUID)
tracker_logo_token required UUID Logo token (UUID) for Webtracker app
account_id optional Integer Account for the brand (can be auto-set from your credentials)

Request

ROUTE
POST /v1/brands
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "name" : "Gucci",
  "email" : "gucci@example.com",
  "phone_number" : "555-555-9999",
  "logo_token" : "67a5bcef-a442-4959-9a99-f4479fb0ffe8",
  "tracker_logo_token" : "263cc559-43e0-4ad0-9d4b-3e045999e038"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

392

BODY
{
  "brand" : {
    "id" : 1,
    "account_id" : 42,
    "name" : "Gucci",
    "phone_number" : "+15555559999",
    "email" : "gucci@example.com",
    "logo_token" : "67a5bcef-a442-4959-9a99-f4479fb0ffe8",
    "tracker_logo_token" : "263cc559-43e0-4ad0-9d4b-3e045999e038",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:07:31+0000",
    "updated_at" : "2016-02-09T16:07:31+0000",
    "version" : "v1",
    "updated_by" : "account:92210a22-c03d-4546-b5c2-b57a06bb5d3e"
  }
}

List brands

List of Brands

Request

ROUTE
GET /v1/brands
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

710

BODY
{
  "brands" : [
    {
      "id" : 2,
      "account_id" : 44,
      "name" : "Brand-1",
      "phone_number" : "+15555550001",
      "email" : "brand-1@example.com",
      "logo_token" : "6bfd160f-3d81-49c1-bbd8-585a19d74582",
      "tracker_logo_token" : "4ba7843d-12b3-45ce-9bc9-21929c2f7007",
      "external_ids" : [],
      "created_at" : "2016-02-09T16:07:31+0000",
      "updated_at" : "2016-02-09T16:07:31+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 3,
      "account_id" : 44,
      "name" : "Brand-2",
      "phone_number" : "+15555550002",
      "email" : "brand-2@example.com",
      "logo_token" : "79f9c490-4693-4f0d-99dd-752b82f53d0e",
      "tracker_logo_token" : "064c938b-b0b4-43e9-9a9a-feb69dd3d528",
      "external_ids" : [],
      "created_at" : "2016-02-09T16:07:31+0000",
      "updated_at" : "2016-02-09T16:07:31+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Brands

Update brand

Updates a Brand for a given set of parameters.

Parameters

Parameter Required Type Description
name optional String Name of Brand
email optional String Brand's email address
phone_number optional String Brand's phone number
logo_token optional UUID Logo token (UUID)
tracker_logo_token optional UUID Logo token (UUID) for Webtracker app

Request

ROUTE
PUT /v1/brands/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "5"
}
BODY
{
  "name" : "New Balance",
  "email" : "nb@example.com",
  "phone_number" : "555-555-9999",
  "logo_token" : "23a153c5-e196-4e8a-9f96-867ed3c3571f",
  "tracker_logo_token" : "11111111-e196-4e8a-9f96-867ed3c3571f"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

395

BODY
{
  "brand" : {
    "id" : 5,
    "account_id" : 46,
    "name" : "New Balance",
    "phone_number" : "+15555559999",
    "email" : "nb@example.com",
    "logo_token" : "23a153c5-e196-4e8a-9f96-867ed3c3571f",
    "tracker_logo_token" : "11111111-e196-4e8a-9f96-867ed3c3571f",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:07:32+0000",
    "updated_at" : "2016-02-09T16:07:32+0000",
    "version" : "v1",
    "updated_by" : "account:ee5b74fd-6aa3-4482-ad58-d63fdb739129"
  }
}

Customer

Create customer

Request

ROUTE
POST /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 227,
  "first_name" : "John",
  "last_name" : "Doe",
  "notes" : "angry",
  "company_name" : "Microsoft",
  "email" : "bill@example.com",
  "custom_fields" : {
    "key34" : "new value"
  },
  "phone_numbers" : {
    "+15551111111" : {
      "type" : "Home",
      "primary" : true
    },
    "+15552222222" : {
      "type" : "Mobile",
      "primary" : false
    }
  },
  "external_ids" : [
    "qb:10001",
    "qb:10002"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

639

BODY
{
  "customer" : {
    "id" : 135,
    "organization_id" : 227,
    "first_name" : "John",
    "last_name" : "Doe",
    "full_name" : "John Doe",
    "company_name" : "Microsoft",
    "email" : "bill@example.com",
    "phone_number" : "+15551111111",
    "phone_numbers" : {
      "+15551111111" : {
        "number" : "+15551111111",
        "type" : "Home",
        "primary" : true
      },
      "+15552222222" : {
        "number" : "+15552222222",
        "type" : "Mobile",
        "primary" : false
      }
    },
    "notes" : "angry",
    "custom_fields" : {
      "key34" : "new value"
    },
    "created_at" : "2016-02-09T16:07:38+0000",
    "updated_at" : "2016-02-09T16:07:38+0000",
    "home_address" : null,
    "billing_address" : null,
    "version" : "v1",
    "updated_by" : "user:958f21d5-d27d-4db2-84e8-580c2b80face",
    "external_ids" : [
      "qb:10001",
      "qb:10002"
    ]
  }
}

Customers API [GET] /customers filtered when filtering by updated_at field

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "updated_at_gteq" : "2016-02-08 16:07:42 UTC"
  },
  "sort" : "id DESC"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

3570

BODY
{
  "customers" : [
    {
      "id" : 185,
      "organization_id" : 252,
      "first_name" : "John-175",
      "last_name" : "C",
      "full_name" : "John-175 C",
      "company_name" : "Company-181",
      "email" : "customer-172@example.com",
      "phone_number" : "+15555550177",
      "phone_numbers" : {
        "+15555550177" : {
          "type" : "Mobile",
          "number" : "+15555550177",
          "primary" : true
        }
      },
      "notes" : "Notes-181",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 184,
      "organization_id" : 251,
      "first_name" : "John-174",
      "last_name" : "Doe-157",
      "full_name" : "John-174 Doe-157",
      "company_name" : "Company-180",
      "email" : "customer-171@example.com",
      "phone_number" : "+15555550176",
      "phone_numbers" : {
        "+15555550176" : {
          "type" : "Mobile",
          "number" : "+15555550176",
          "primary" : true
        }
      },
      "notes" : "Notes-180",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 183,
      "organization_id" : 251,
      "first_name" : "John-173",
      "last_name" : "Doe-156",
      "full_name" : "John-173 Doe-156",
      "company_name" : "Company-179",
      "email" : "customer-170@example.com",
      "phone_number" : "+15555550175",
      "phone_numbers" : {
        "+15555550175" : {
          "type" : "Mobile",
          "number" : "+15555550175",
          "primary" : true
        }
      },
      "notes" : "Notes-179",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Filter by address

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "address" : "avenue"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2363

BODY
{
  "customers" : [
    {
      "id" : 174,
      "organization_id" : 249,
      "first_name" : "John-165",
      "last_name" : "A",
      "full_name" : "John-165 A",
      "company_name" : "Company-170",
      "email" : "customer-161@example.com",
      "phone_number" : "+15555550167",
      "phone_numbers" : {
        "+15555550167" : {
          "type" : "Mobile",
          "number" : "+15555550167",
          "primary" : true
        }
      },
      "notes" : "Notes-170",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "1st Avenue",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 175,
      "organization_id" : 249,
      "first_name" : "John-166",
      "last_name" : "B",
      "full_name" : "John-166 B",
      "company_name" : "Company-171",
      "email" : "customer-162@example.com",
      "phone_number" : "+15555550168",
      "phone_numbers" : {
        "+15555550168" : {
          "type" : "Mobile",
          "number" : "+15555550168",
          "primary" : true
        }
      },
      "notes" : "Notes-171",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "2nd Avenue",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Filter by email

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "email_cont" : "bob"
  },
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2380

BODY
{
  "customers" : [
    {
      "id" : 172,
      "organization_id" : 248,
      "first_name" : "John-163",
      "last_name" : "Doe-149",
      "full_name" : "John-163 Doe-149",
      "company_name" : "Company-168",
      "email" : "john-bob@example.com",
      "phone_number" : "+15555550165",
      "phone_numbers" : {
        "+15555550165" : {
          "type" : "Mobile",
          "number" : "+15555550165",
          "primary" : true
        }
      },
      "notes" : "Notes-168",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 171,
      "organization_id" : 248,
      "first_name" : "John-162",
      "last_name" : "Doe-148",
      "full_name" : "John-162 Doe-148",
      "company_name" : "Company-167",
      "email" : "bob@example.com",
      "phone_number" : "+15555550164",
      "phone_numbers" : {
        "+15555550164" : {
          "type" : "Mobile",
          "number" : "+15555550164",
          "primary" : true
        }
      },
      "notes" : "Notes-167",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Filter by external_ids (full)

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_external_ids" : "qb:123"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2420

BODY
{
  "customers" : [
    {
      "id" : 156,
      "organization_id" : 241,
      "first_name" : "John-150",
      "last_name" : "Doe-137",
      "full_name" : "John-150 Doe-137",
      "company_name" : "Company-152",
      "email" : "customer-146@example.com",
      "phone_number" : "+15555550152",
      "phone_numbers" : {
        "+15555550152" : {
          "type" : "Mobile",
          "number" : "+15555550152",
          "primary" : true
        }
      },
      "notes" : "Notes-152",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:123",
        "qb:23"
      ]
    },
    {
      "id" : 157,
      "organization_id" : 241,
      "first_name" : "John-151",
      "last_name" : "Doe-138",
      "full_name" : "John-151 Doe-138",
      "company_name" : "Company-153",
      "email" : "customer-147@example.com",
      "phone_number" : "+15555550153",
      "phone_numbers" : {
        "+15555550153" : {
          "type" : "Mobile",
          "number" : "+15555550153",
          "primary" : true
        }
      },
      "notes" : "Notes-153",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:123:32"
      ]
    }
  ]
}

Filter by external_ids (full)

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_external_ids" : [
      "qb:123"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2420

BODY
{
  "customers" : [
    {
      "id" : 153,
      "organization_id" : 240,
      "first_name" : "John-147",
      "last_name" : "Doe-134",
      "full_name" : "John-147 Doe-134",
      "company_name" : "Company-149",
      "email" : "customer-143@example.com",
      "phone_number" : "+15555550149",
      "phone_numbers" : {
        "+15555550149" : {
          "type" : "Mobile",
          "number" : "+15555550149",
          "primary" : true
        }
      },
      "notes" : "Notes-149",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:123",
        "qb:23"
      ]
    },
    {
      "id" : 154,
      "organization_id" : 240,
      "first_name" : "John-148",
      "last_name" : "Doe-135",
      "full_name" : "John-148 Doe-135",
      "company_name" : "Company-150",
      "email" : "customer-144@example.com",
      "phone_number" : "+15555550150",
      "phone_numbers" : {
        "+15555550150" : {
          "type" : "Mobile",
          "number" : "+15555550150",
          "primary" : true
        }
      },
      "notes" : "Notes-150",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:123:32"
      ]
    }
  ]
}

Filter by external_ids (partial)

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "external_ids_contains" : [
      "qb:123:32"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1215

BODY
{
  "customers" : [
    {
      "id" : 160,
      "organization_id" : 242,
      "first_name" : "John-154",
      "last_name" : "Doe-141",
      "full_name" : "John-154 Doe-141",
      "company_name" : "Company-156",
      "email" : "customer-150@example.com",
      "phone_number" : "+15555550156",
      "phone_numbers" : {
        "+15555550156" : {
          "type" : "Mobile",
          "number" : "+15555550156",
          "primary" : true
        }
      },
      "notes" : "Notes-156",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:123:32"
      ]
    }
  ]
}

Filter by name

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "full_name_cont" : "bob"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2363

BODY
{
  "customers" : [
    {
      "id" : 165,
      "organization_id" : 246,
      "first_name" : "joe",
      "last_name" : "bobs",
      "full_name" : "joe bobs",
      "company_name" : "Company-161",
      "email" : "customer-155@example.com",
      "phone_number" : "+15555550161",
      "phone_numbers" : {
        "+15555550161" : {
          "type" : "Mobile",
          "number" : "+15555550161",
          "primary" : true
        }
      },
      "notes" : "Notes-161",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 166,
      "organization_id" : 246,
      "first_name" : "bob",
      "last_name" : "smith",
      "full_name" : "bob smith",
      "company_name" : "Company-162",
      "email" : "customer-156@example.com",
      "phone_number" : "+15555550162",
      "phone_numbers" : {
        "+15555550162" : {
          "type" : "Mobile",
          "number" : "+15555550162",
          "primary" : true
        }
      },
      "notes" : "Notes-162",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Filter by organization

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "organization_id_eq" : "243"
  },
  "sort" : "id DESC"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2393

BODY
{
  "customers" : [
    {
      "id" : 163,
      "organization_id" : 243,
      "first_name" : "John-157",
      "last_name" : "Doe-144",
      "full_name" : "John-157 Doe-144",
      "company_name" : "Company-159",
      "email" : "customer-153@example.com",
      "phone_number" : "+15555550159",
      "phone_numbers" : {
        "+15555550159" : {
          "type" : "Mobile",
          "number" : "+15555550159",
          "primary" : true
        }
      },
      "notes" : "Notes-159",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 162,
      "organization_id" : 243,
      "first_name" : "John-156",
      "last_name" : "Doe-143",
      "full_name" : "John-156 Doe-143",
      "company_name" : "Company-158",
      "email" : "customer-152@example.com",
      "phone_number" : "+15555550158",
      "phone_numbers" : {
        "+15555550158" : {
          "type" : "Mobile",
          "number" : "+15555550158",
          "primary" : true
        }
      },
      "notes" : "Notes-158",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Filter by phone number

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "phone_numbers_as_text_cont" : "11"
  },
  "sort" : "id asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2393

BODY
{
  "customers" : [
    {
      "id" : 168,
      "organization_id" : 247,
      "first_name" : "John-159",
      "last_name" : "Doe-145",
      "full_name" : "John-159 Doe-145",
      "company_name" : "Company-164",
      "email" : "customer-158@example.com",
      "phone_number" : "+15551110000",
      "phone_numbers" : {
        "+15551110000" : {
          "type" : "Mobile",
          "number" : "+15551110000",
          "primary" : true
        }
      },
      "notes" : "Notes-164",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 169,
      "organization_id" : 247,
      "first_name" : "John-160",
      "last_name" : "Doe-146",
      "full_name" : "John-160 Doe-146",
      "company_name" : "Company-165",
      "email" : "customer-159@example.com",
      "phone_number" : "+15551120000",
      "phone_numbers" : {
        "+15551120000" : {
          "type" : "Mobile",
          "number" : "+15551120000",
          "primary" : true
        }
      },
      "notes" : "Notes-165",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:41+0000",
      "updated_at" : "2016-02-09T16:07:41+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:41+0000",
        "updated_at" : "2016-02-09T16:07:41+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

List customers

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2369

BODY
{
  "customers" : [
    {
      "id" : 140,
      "organization_id" : 233,
      "first_name" : "John-134",
      "last_name" : "A",
      "full_name" : "John-134 A",
      "company_name" : "Company-136",
      "email" : "customer-130@example.com",
      "phone_number" : "+15555550136",
      "phone_numbers" : {
        "+15555550136" : {
          "type" : "Mobile",
          "number" : "+15555550136",
          "primary" : true
        }
      },
      "notes" : "Notes-136",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:39+0000",
      "updated_at" : "2016-02-09T16:07:39+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 141,
      "organization_id" : 233,
      "first_name" : "John-135",
      "last_name" : "B",
      "full_name" : "John-135 B",
      "company_name" : "Company-137",
      "email" : "customer-131@example.com",
      "phone_number" : "+15555550137",
      "phone_numbers" : {
        "+15555550137" : {
          "type" : "Mobile",
          "number" : "+15555550137",
          "primary" : true
        }
      },
      "notes" : "Notes-137",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:39+0000",
      "updated_at" : "2016-02-09T16:07:39+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Search by anything match

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "search" : "777"
  },
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

5936

BODY
{
  "customers" : [
    {
      "id" : 181,
      "organization_id" : 250,
      "first_name" : "John-171",
      "last_name" : "777",
      "full_name" : "John-171 777",
      "company_name" : "Company-177",
      "email" : "customer-168@example.com",
      "phone_number" : "+15555550173",
      "phone_numbers" : {
        "+15555550173" : {
          "type" : "Mobile",
          "number" : "+15555550173",
          "primary" : true
        }
      },
      "notes" : "Notes-177",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 180,
      "organization_id" : 250,
      "first_name" : "777",
      "last_name" : "Doe-154",
      "full_name" : "777 Doe-154",
      "company_name" : "Company-176",
      "email" : "customer-167@example.com",
      "phone_number" : "+15555550172",
      "phone_numbers" : {
        "+15555550172" : {
          "type" : "Mobile",
          "number" : "+15555550172",
          "primary" : true
        }
      },
      "notes" : "Notes-176",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 179,
      "organization_id" : 250,
      "first_name" : "John-170",
      "last_name" : "Doe-153",
      "full_name" : "John-170 Doe-153",
      "company_name" : "Company-175",
      "email" : "customer-166@example.com",
      "phone_number" : "+15557779999",
      "phone_numbers" : {
        "+15557779999" : {
          "type" : "Mobile",
          "number" : "+15557779999",
          "primary" : true
        }
      },
      "notes" : "Notes-175",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 178,
      "organization_id" : 250,
      "first_name" : "John-169",
      "last_name" : "Doe-152",
      "full_name" : "John-169 Doe-152",
      "company_name" : "Company-174",
      "email" : "customer-165@example.com",
      "phone_number" : "+15555550171",
      "phone_numbers" : {
        "+15555550171" : {
          "type" : "Mobile",
          "number" : "+15555550171",
          "primary" : true
        }
      },
      "notes" : "Notes-174",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "777 Avenue",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 177,
      "organization_id" : 250,
      "first_name" : "John-168",
      "last_name" : "Doe-151",
      "full_name" : "John-168 Doe-151",
      "company_name" : "Company-173",
      "email" : "customer-164@example.com",
      "phone_number" : "+15555550170",
      "phone_numbers" : {
        "+15555550170" : {
          "type" : "Mobile",
          "number" : "+15555550170",
          "primary" : true
        }
      },
      "notes" : "Notes-173",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:42+0000",
      "updated_at" : "2016-02-09T16:07:42+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "777 Avenue",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:42+0000",
        "updated_at" : "2016-02-09T16:07:42+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Sorting example

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "last_name asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2369

BODY
{
  "customers" : [
    {
      "id" : 143,
      "organization_id" : 235,
      "first_name" : "John-137",
      "last_name" : "A",
      "full_name" : "John-137 A",
      "company_name" : "Company-139",
      "email" : "customer-133@example.com",
      "phone_number" : "+15555550139",
      "phone_numbers" : {
        "+15555550139" : {
          "type" : "Mobile",
          "number" : "+15555550139",
          "primary" : true
        }
      },
      "notes" : "Notes-139",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:39+0000",
      "updated_at" : "2016-02-09T16:07:39+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 144,
      "organization_id" : 235,
      "first_name" : "John-138",
      "last_name" : "B",
      "full_name" : "John-138 B",
      "company_name" : "Company-140",
      "email" : "customer-134@example.com",
      "phone_number" : "+15555550140",
      "phone_numbers" : {
        "+15555550140" : {
          "type" : "Mobile",
          "number" : "+15555550140",
          "primary" : true
        }
      },
      "notes" : "Notes-140",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:39+0000",
      "updated_at" : "2016-02-09T16:07:39+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:39+0000",
        "updated_at" : "2016-02-09T16:07:39+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

paginated list of customers

Request

ROUTE
GET /v1/customers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "offset" : "1",
  "limit" : "2"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2369

BODY
{
  "customers" : [
    {
      "id" : 150,
      "organization_id" : 239,
      "first_name" : "John-144",
      "last_name" : "B",
      "full_name" : "John-144 B",
      "company_name" : "Company-146",
      "email" : "customer-140@example.com",
      "phone_number" : "+15555550146",
      "phone_numbers" : {
        "+15555550146" : {
          "type" : "Mobile",
          "number" : "+15555550146",
          "primary" : true
        }
      },
      "notes" : "Notes-146",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    },
    {
      "id" : 151,
      "organization_id" : 239,
      "first_name" : "John-145",
      "last_name" : "C",
      "full_name" : "John-145 C",
      "company_name" : "Company-147",
      "email" : "customer-141@example.com",
      "phone_number" : "+15555550147",
      "phone_numbers" : {
        "+15555550147" : {
          "type" : "Mobile",
          "number" : "+15555550147",
          "primary" : true
        }
      },
      "notes" : "Notes-147",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:40+0000",
      "updated_at" : "2016-02-09T16:07:40+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:40+0000",
        "updated_at" : "2016-02-09T16:07:40+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  ]
}

Update a customer

Request

ROUTE
PATCH /v1/customers/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "186"
}
BODY
{
  "first_name" : "Mike",
  "last_name" : "Smith",
  "notes" : "Best customer",
  "company_name" : "Plumbing Inc",
  "email" : "new@example.com",
  "custom_fields" : {
    "key35" : "L"
  },
  "home_address_id" : 875,
  "billing_address_id" : 876,
  "phone_number" : "555-333-3333",
  "phone_numbers" : {
    "+15551111111" : {
      "number" : "+15551111111",
      "type" : "Mobile",
      "primary" : false
    },
    "+15552222222" : {
      "number" : "+15552222222",
      "type" : "Fax",
      "primary" : true
    }
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

623

BODY
{
  "customer" : {
    "id" : 186,
    "organization_id" : 254,
    "first_name" : "Mike",
    "last_name" : "Smith",
    "full_name" : "Mike Smith",
    "company_name" : "Plumbing Inc",
    "email" : "new@example.com",
    "phone_number" : "+15552222222",
    "phone_numbers" : {
      "+15552222222" : {
        "number" : "+15552222222",
        "type" : "Fax",
        "primary" : true
      },
      "+15551111111" : {
        "number" : "+15551111111",
        "type" : "Mobile",
        "primary" : false
      }
    },
    "notes" : "Best customer",
    "custom_fields" : {
      "key35" : "L"
    },
    "created_at" : "2016-02-09T16:07:43+0000",
    "updated_at" : "2016-02-09T16:07:43+0000",
    "home_address" : null,
    "billing_address" : null,
    "version" : "v1",
    "updated_by" : "user:3d0acc28-edfb-4b6b-986b-b24f40e8709b",
    "external_ids" : []
  }
}

Event

Create comment for a job

Creates an Event for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
job_id optional Integer Job ID
event required String String representation of event.
Most of events are created automatically.
Currently implemented values are: https://gist.github.com/creeonix/b8b4f6b390a753d9f786
event_entity_id required Integer ID of an entity which will be attached to the event
event_entity_type required String Name of the entity which will be attached to the event.
Most common values are: User, Job, Appointment, BillingDocument, Inventory, Account, Organization
parameters optional Hash Hash to be stored with an event
photo_token optional UUID Photo image token (UUID)

Request

ROUTE
POST /v1/events
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "job_id" : 128,
  "message" : "Event message"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

741

BODY
{
  "event" : {
    "id" : 213,
    "organization_id" : 268,
    "event" : "comment",
    "event_entity_id" : 128,
    "event_entity_type" : "Job",
    "creator_id" : 307,
    "creator_type" : "User",
    "parameters" : {
      "comment" : "Event message",
      "meta" : {
        "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
        "api_version" : "2.0.35",
        "client" : {
          "vendor" : "Dispatch",
          "name" : "TestSuite",
          "version" : "2.0.35"
        },
        "device" : {
          "model" : "iPhone 5,1",
          "platform" : "iOS",
          "version" : "8.1.3"
        }
      }
    },
    "created_at" : "2016-02-09T16:07:45+0000",
    "updated_at" : "2016-02-09T16:07:45+0000",
    "event_user" : {
      "full_name" : "Bob 307 Smith 307",
      "photo_token" : "bfaae562-1797-4ba1-9e4d-e8f9edc1e2d3"
    },
    "version" : "v1",
    "updated_by" : "user:6bb8bedc-0992-4e06-949b-b31b4f72b90e"
  }
}

List events

List of Events for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/events
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1392

BODY
{
  "events" : [
    {
      "id" : 216,
      "organization_id" : 273,
      "event" : "comment",
      "event_entity_id" : 133,
      "event_entity_type" : "Job",
      "creator_id" : 310,
      "creator_type" : "User",
      "parameters" : {
        "text" : "well done",
        "meta" : {
          "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
          "api_version" : "2.0.35",
          "client" : {
            "vendor" : "Dispatch",
            "name" : "TestSuite",
            "version" : "2.0.35"
          },
          "device" : {
            "model" : "iPhone 5,1",
            "platform" : "iOS",
            "version" : "8.1.3"
          }
        }
      },
      "created_at" : "2016-02-08T16:07:46+0000",
      "updated_at" : "2016-02-09T16:07:46+0000",
      "event_user" : {
        "full_name" : "Bob 310 Smith 310",
        "photo_token" : "214ac3e8-ca69-403e-8e24-9f118c399e09"
      },
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 215,
      "organization_id" : 273,
      "event" : "comment",
      "event_entity_id" : 133,
      "event_entity_type" : "Job",
      "creator_id" : 310,
      "creator_type" : "User",
      "parameters" : {
        "text" : "well done",
        "meta" : {
          "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
          "api_version" : "2.0.35",
          "client" : {
            "vendor" : "Dispatch",
            "name" : "TestSuite",
            "version" : "2.0.35"
          },
          "device" : {
            "model" : "iPhone 5,1",
            "platform" : "iOS",
            "version" : "8.1.3"
          }
        }
      },
      "created_at" : "2016-02-07T16:07:46+0000",
      "updated_at" : "2016-02-09T16:07:46+0000",
      "event_user" : {
        "full_name" : "Bob 310 Smith 310",
        "photo_token" : "214ac3e8-ca69-403e-8e24-9f118c399e09"
      },
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Paginated events

List of Events for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/events
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "offset" : "1",
  "limit" : "2",
  "sort" : "created_at asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1392

BODY
{
  "events" : [
    {
      "id" : 222,
      "organization_id" : 277,
      "event" : "comment",
      "event_entity_id" : 137,
      "event_entity_type" : "Job",
      "creator_id" : 314,
      "creator_type" : "User",
      "parameters" : {
        "text" : "well done",
        "meta" : {
          "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
          "api_version" : "2.0.35",
          "client" : {
            "vendor" : "Dispatch",
            "name" : "TestSuite",
            "version" : "2.0.35"
          },
          "device" : {
            "model" : "iPhone 5,1",
            "platform" : "iOS",
            "version" : "8.1.3"
          }
        }
      },
      "created_at" : "2016-02-05T16:07:46+0000",
      "updated_at" : "2016-02-09T16:07:46+0000",
      "event_user" : {
        "full_name" : "Bob 314 Smith 314",
        "photo_token" : "dd65fc49-d4c5-40ba-b484-a2d08ab204a8"
      },
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 223,
      "organization_id" : 277,
      "event" : "comment",
      "event_entity_id" : 137,
      "event_entity_type" : "Job",
      "creator_id" : 314,
      "creator_type" : "User",
      "parameters" : {
        "text" : "well done",
        "meta" : {
          "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
          "api_version" : "2.0.35",
          "client" : {
            "vendor" : "Dispatch",
            "name" : "TestSuite",
            "version" : "2.0.35"
          },
          "device" : {
            "model" : "iPhone 5,1",
            "platform" : "iOS",
            "version" : "8.1.3"
          }
        }
      },
      "created_at" : "2016-02-06T16:07:46+0000",
      "updated_at" : "2016-02-09T16:07:46+0000",
      "event_user" : {
        "full_name" : "Bob 314 Smith 314",
        "photo_token" : "dd65fc49-d4c5-40ba-b484-a2d08ab204a8"
      },
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Sorted by date

List of Events for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/events
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "created_at desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1392

BODY
{
  "events" : [
    {
      "id" : 219,
      "organization_id" : 275,
      "event" : "comment",
      "event_entity_id" : 135,
      "event_entity_type" : "Job",
      "creator_id" : 312,
      "creator_type" : "User",
      "parameters" : {
        "text" : "well done",
        "meta" : {
          "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
          "api_version" : "2.0.35",
          "client" : {
            "vendor" : "Dispatch",
            "name" : "TestSuite",
            "version" : "2.0.35"
          },
          "device" : {
            "model" : "iPhone 5,1",
            "platform" : "iOS",
            "version" : "8.1.3"
          }
        }
      },
      "created_at" : "2016-02-08T16:07:46+0000",
      "updated_at" : "2016-02-09T16:07:46+0000",
      "event_user" : {
        "full_name" : "Bob 312 Smith 312",
        "photo_token" : "b4918041-c18c-46a1-ae5a-9ad259ed16f8"
      },
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 218,
      "organization_id" : 275,
      "event" : "comment",
      "event_entity_id" : 135,
      "event_entity_type" : "Job",
      "creator_id" : 312,
      "creator_type" : "User",
      "parameters" : {
        "text" : "well done",
        "meta" : {
          "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",
          "api_version" : "2.0.35",
          "client" : {
            "vendor" : "Dispatch",
            "name" : "TestSuite",
            "version" : "2.0.35"
          },
          "device" : {
            "model" : "iPhone 5,1",
            "platform" : "iOS",
            "version" : "8.1.3"
          }
        }
      },
      "created_at" : "2016-02-07T16:07:46+0000",
      "updated_at" : "2016-02-09T16:07:46+0000",
      "event_user" : {
        "full_name" : "Bob 312 Smith 312",
        "photo_token" : "b4918041-c18c-46a1-ae5a-9ad259ed16f8"
      },
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Payment

Cash payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "74"
}
BODY
{
  "amount" : 100.1,
  "payment_method" : "cash"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

431

BODY
{
  "payment" : {
    "id" : 16,
    "billing_document_id" : 74,
    "result" : "success",
    "amount" : {
      "value" : "100.10",
      "currency" : "USD",
      "text" : "$100.10"
    },
    "payment_method" : "cash",
    "transaction_id" : null,
    "card_number" : null,
    "card_type" : null,
    "card_name" : null,
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:31+0000",
    "updated_at" : "2016-02-09T16:08:31+0000",
    "payment_at" : null,
    "reference" : null,
    "version" : "v1",
    "updated_by" : "user:9ee9e050-f69b-4039-a98f-034fcbac955b"
  }
}

Check payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "75"
}
BODY
{
  "amount" : 100.2,
  "payment_method" : "check",
  "check_number" : "foo"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

433

BODY
{
  "payment" : {
    "id" : 17,
    "billing_document_id" : 75,
    "result" : "success",
    "amount" : {
      "value" : "100.20",
      "currency" : "USD",
      "text" : "$100.20"
    },
    "payment_method" : "check",
    "transaction_id" : "foo",
    "card_number" : null,
    "card_type" : null,
    "card_name" : null,
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:31+0000",
    "updated_at" : "2016-02-09T16:08:31+0000",
    "payment_at" : null,
    "reference" : null,
    "version" : "v1",
    "updated_by" : "user:8dcb9c5b-8401-4cba-a920-a8af3894233d"
  }
}

Credit Card payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "65"
}
BODY
{
  "amount" : 4.13,
  "payment_method" : "card",
  "card_token" : "O7nKwsmUImbDiXOKKDRotanqX5j",
  "payment_at" : "2016-02-09T16:08:29+0000",
  "reference" : "ref"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

482

BODY
{
  "payment" : {
    "id" : 12,
    "billing_document_id" : 65,
    "result" : "success",
    "amount" : {
      "value" : "4.13",
      "currency" : "USD",
      "text" : "$4.13"
    },
    "payment_method" : "card",
    "transaction_id" : "49",
    "card_number" : "XXXX-XXXX-XXXX-4444",
    "card_type" : "master",
    "card_name" : "Perrin Aybara",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:29+0000",
    "updated_at" : "2016-02-09T16:08:29+0000",
    "payment_at" : "2016-02-09T16:08:29+0000",
    "reference" : "ref",
    "version" : "v1",
    "updated_by" : "user:7c9b685b-e473-4e57-9448-ecaa7f4cbdd3"
  }
}

Credit Card payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "66"
}
BODY
{
  "amount" : 30.66,
  "payment_method" : "card",
  "card_token" : "MDxps2AJzo0dQPeVTPyLDe9Z62k"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

461

BODY
{
  "payment" : {
    "id" : 13,
    "billing_document_id" : 66,
    "result" : "success",
    "amount" : {
      "value" : "30.66",
      "currency" : "USD",
      "text" : "$30.66"
    },
    "payment_method" : "card",
    "transaction_id" : "61",
    "card_number" : "XXXX-XXXX-XXXX-4444",
    "card_type" : "master",
    "card_name" : "Perrin Aybara",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:29+0000",
    "updated_at" : "2016-02-09T16:08:29+0000",
    "payment_at" : null,
    "reference" : null,
    "version" : "v1",
    "updated_by" : "user:617e5d50-865b-4eda-83e0-1b761c4e53ed"
  }
}

Credit Card payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "67"
}
BODY
{
  "amount" : 40.13,
  "reference" : "",
  "payment_method" : "card",
  "payment_at" : "2015-12-08T14:18:36.996Z"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

449

BODY
{
  "payment" : {
    "id" : 14,
    "billing_document_id" : 67,
    "result" : "success",
    "amount" : {
      "value" : "40.13",
      "currency" : "USD",
      "text" : "$40.13"
    },
    "payment_method" : "card",
    "transaction_id" : null,
    "card_number" : null,
    "card_type" : null,
    "card_name" : null,
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:29+0000",
    "updated_at" : "2016-02-09T16:08:29+0000",
    "payment_at" : "2015-12-08T14:18:36+0000",
    "reference" : "",
    "version" : "v1",
    "updated_by" : "user:fcb74653-07ce-4ada-9f68-4cef4e85e241"
  }
}

List payments

returns List of Payments by given set of filters

Request

ROUTE
GET /v1/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

796

BODY
{
  "payments" : [
    {
      "id" : 25,
      "billing_document_id" : 87,
      "result" : "success",
      "amount" : {
        "value" : "23.45",
        "currency" : "USD",
        "text" : "$23.45"
      },
      "payment_method" : "cash",
      "transaction_id" : "abcdefgh13",
      "card_number" : null,
      "card_type" : null,
      "card_name" : null,
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:34+0000",
      "updated_at" : "2016-02-09T16:08:34+0000",
      "payment_at" : null,
      "reference" : null,
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 24,
      "billing_document_id" : 87,
      "result" : "success",
      "amount" : {
        "value" : "12.34",
        "currency" : "USD",
        "text" : "$12.34"
      },
      "payment_method" : "cash",
      "transaction_id" : "abcdefgh12",
      "card_number" : null,
      "card_type" : null,
      "card_name" : null,
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:34+0000",
      "updated_at" : "2016-02-09T16:08:34+0000",
      "payment_at" : null,
      "reference" : null,
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Sum of payments amount

returns List of Payments by given set of filters

Request

ROUTE
GET /v1/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_group" : {
      "column" : "amount_cents",
      "aggregate" : "sum"
    }
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

24

BODY
[
  {
    "id" : null,
    "sum" : 3579
  }
]

Payment V2

Cash payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "210"
}
BODY
{
  "amount" : 100.1,
  "payment_method" : "cash"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

432

BODY
{
  "payment" : {
    "id" : 47,
    "billing_document_id" : 210,
    "result" : "success",
    "amount" : {
      "value" : "100.10",
      "currency" : "USD",
      "text" : "$100.10"
    },
    "payment_method" : "cash",
    "transaction_id" : null,
    "card_number" : null,
    "card_type" : null,
    "card_name" : null,
    "external_ids" : [],
    "created_at" : "2016-02-09T16:09:56+0000",
    "updated_at" : "2016-02-09T16:09:56+0000",
    "payment_at" : null,
    "reference" : null,
    "version" : "v1",
    "updated_by" : "user:d891bec7-b641-4237-a799-61b77cad8bf9"
  }
}

Check payment

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "211"
}
BODY
{
  "amount" : 100.2,
  "payment_method" : "check",
  "check_number" : "foo"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

434

BODY
{
  "payment" : {
    "id" : 48,
    "billing_document_id" : 211,
    "result" : "success",
    "amount" : {
      "value" : "100.20",
      "currency" : "USD",
      "text" : "$100.20"
    },
    "payment_method" : "check",
    "transaction_id" : "foo",
    "card_number" : null,
    "card_type" : null,
    "card_name" : null,
    "external_ids" : [],
    "created_at" : "2016-02-09T16:09:56+0000",
    "updated_at" : "2016-02-09T16:09:56+0000",
    "payment_at" : null,
    "reference" : null,
    "version" : "v1",
    "updated_by" : "user:8b0f26c5-db5b-41a8-8bb3-a8686344943d"
  }
}

Credit Card payment with processing

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "201"
}
BODY
{
  "amount" : 13.13,
  "payment_method" : "card",
  "card_token" : "R23k2P6TGlkLo7j1HJlzlSeNc7M"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

462

BODY
{
  "payment" : {
    "id" : 43,
    "billing_document_id" : 201,
    "result" : "success",
    "amount" : {
      "value" : "13.13",
      "currency" : "USD",
      "text" : "$13.13"
    },
    "payment_method" : "card",
    "transaction_id" : "48",
    "card_number" : "XXXX-XXXX-XXXX-4444",
    "card_type" : "master",
    "card_name" : "Perrin Aybara",
    "external_ids" : [],
    "created_at" : "2016-02-09T16:09:53+0000",
    "updated_at" : "2016-02-09T16:09:53+0000",
    "payment_at" : null,
    "reference" : null,
    "version" : "v1",
    "updated_by" : "user:246874a9-12ca-44e6-91fd-5a4e862d7729"
  }
}

Credit Card payment without processing

Process a payment for an Invoice

Parameters

Parameter Required Type Description
amount required Float Amount to be charged
payment_method required String Payment Method: cash, card or check
card_token optional Spreedly token of Credit Card info for payment, used only for payment_method = card.
payment_at optional Date tile Define payment_at
reference optional String Define reference

Request

ROUTE
POST /v1/invoices/:invoice_id/payments
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "invoice_id" : "203"
}
BODY
{
  "amount" : 1.13,
  "reference" : "",
  "payment_method" : "card",
  "payment_at" : "2015-12-08T14:18:36.996Z"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

448

BODY
{
  "payment" : {
    "id" : 45,
    "billing_document_id" : 203,
    "result" : "success",
    "amount" : {
      "value" : "1.13",
      "currency" : "USD",
      "text" : "$1.13"
    },
    "payment_method" : "card",
    "transaction_id" : null,
    "card_number" : null,
    "card_type" : null,
    "card_name" : null,
    "external_ids" : [],
    "created_at" : "2016-02-09T16:09:54+0000",
    "updated_at" : "2016-02-09T16:09:54+0000",
    "payment_at" : "2015-12-08T14:18:36+0000",
    "reference" : "",
    "version" : "v1",
    "updated_by" : "user:c724cba2-4835-4258-a99a-b4b1fdd0a361"
  }
}

Job Offer

Create job offer

Request

ROUTE
POST /v1/job_offers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "ui_options" : {
    "show_decline" : true,
    "accept_title" : "accept",
    "decline_title" : "Decline",
    "accept_hint" : null,
    "decline_hint" : null,
    "decline_text" : "Text to be shown in popup if decline is not allowed",
    "reject_reasons" : [
      "incorrect_service_area",
      "no_availability",
      "wrong_trade"
    ]
  },
  "acknowledge_only" : true,
  "offer_strategy" : "round_robin",
  "duration" : 3600,
  "duration_algorithm" : 1,
  "duration_algorithm_options" : {
    "option" : "value"
  },
  "expires_at" : "2016-02-09T16:52:48+00:00",
  "selection_strategy" : "given",
  "selection_options" : {
    "date_range" : 7
  },
  "entities" : [
    {
      "id" : 288,
      "type" : "organization",
      "options" : {
        "pay" : 150,
        "appointment" : null
      }
    },
    {
      "id" : 289,
      "type" : "organization",
      "options" : {
        "pay" : 250,
        "foo" : "bar",
        "duration_algorithm" : null
      }
    },
    {
      "external_id" : "2A036",
      "type" : "organization"
    },
    {
      "type" : "organization",
      "data" : {
        "name" : "Test Name",
        "email" : "some@example.com",
        "url" : "http://example.com",
        "phone_number" : "(555)555-4444",
        "service_types" : {
          "plumber" : "Plumber"
        },
        "timezone" : "Eastern Time (US & Canada)",
        "country" : "Canada",
        "line_item_level_tax" : true,
        "max_job_drive_time" : 30,
        "external_ids" : [
          "123456"
        ]
      },
      "options" : {
        "pay" : 250,
        "foo" : "bar",
        "duration_algorithm" : null
      }
    },
    {
      "type" : "organization",
      "external_id" : "787878",
      "data" : {
        "name" : "Organization 3",
        "email" : "dispatch-291@example.com",
        "phone_number" : "+15555550291"
      }
    },
    {
      "type" : "organization",
      "id" : 287
    }
  ],
  "customer" : {
    "external_id" : "10001",
    "first_name" : "John-196",
    "last_name" : "Doe-178",
    "notes" : "Notes-202",
    "company_name" : "Company-202",
    "email" : "customer-193@example.com",
    "custom_fields" : {
      "key33" : "new value"
    },
    "phone_numbers" : [
      {
        "number" : "+15555550205",
        "type" : "Mobile",
        "primary" : true
      }
    ],
    "payer_external_id" : "ns10414billcust",
    "home_address" : {
      "latitude" : 0.13,
      "longitude" : -1.23,
      "postal_code" : "01234",
      "city" : "Boston",
      "state" : "MA",
      "street_1" : "123 Summer St",
      "street_2" : "apt. 1",
      "country" : "United States"
    }
  },
  "job" : {
    "title" : "Toilet flooding",
    "description" : "in the basement",
    "address" : {
      "latitude" : 0.13,
      "longitude" : -1.23,
      "postal_code" : "01234",
      "city" : "Boston",
      "state" : "MA",
      "street_1" : "123 Summer St",
      "street_2" : "apt. 1",
      "country" : "United States"
    },
    "service_type" : "plumber",
    "custom_fields" : {}
  },
  "appointment" : {
    "strategy" : "default",
    "window_start_time" : [
      "2015-12-30T09:00:00+00:00",
      "2015-12-31T09:00:00+00:00"
    ],
    "window_end_time" : [
      "2015-12-30T12:00:00+00:00",
      "2015-12-31T09:00:00+00:00"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4014

BODY
{
  "job_offer" : {
    "id" : 1,
    "account_id" : 61,
    "status" : "new",
    "ui_options" : {
      "show_decline" : true,
      "accept_title" : "accept",
      "decline_title" : "Decline",
      "accept_hint" : null,
      "decline_hint" : null,
      "decline_text" : "Text to be shown in popup if decline is not allowed",
      "reject_reasons" : [
        "incorrect_service_area",
        "no_availability",
        "wrong_trade"
      ]
    },
    "acknowledge_only" : true,
    "offer_strategy" : "round_robin",
    "duration" : 3600,
    "duration_algorithm" : 1,
    "duration_algorithm_options" : {
      "option" : "value"
    },
    "selection_strategy" : "given",
    "selection_options" : {
      "date_range" : "7"
    },
    "expires_at" : "2016-02-09T16:52:48+0000",
    "completed_at" : null,
    "created_at" : "2016-02-09T16:07:49+0000",
    "updated_at" : "2016-02-09T16:07:49+0000",
    "customer" : {
      "external_id" : "10001",
      "first_name" : "John-196",
      "last_name" : "Doe-178",
      "notes" : "Notes-202",
      "company_name" : "Company-202",
      "email" : "customer-193@example.com",
      "custom_fields" : {
        "key33" : "new value"
      },
      "phone_numbers" : [
        {
          "number" : "+15555550205",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "payer_external_id" : "ns10414billcust",
      "home_address" : {
        "latitude" : 0.13,
        "longitude" : -1.23,
        "postal_code" : "01234",
        "city" : "Boston",
        "state" : "MA",
        "street_1" : "123 Summer St",
        "street_2" : "apt. 1",
        "country" : "United States"
      },
      "billing_address" : {
        "latitude" : 0.13,
        "longitude" : -1.23,
        "postal_code" : "01234",
        "city" : "Boston",
        "state" : "MA",
        "street_1" : "123 Summer St",
        "street_2" : "apt. 1",
        "country" : "United States",
        "attention_to" : null,
        "company_name" : null
      }
    },
    "job" : {
      "title" : "Toilet flooding",
      "description" : "in the basement",
      "address" : {
        "latitude" : 0.13,
        "longitude" : -1.23,
        "postal_code" : "01234",
        "city" : "Boston",
        "state" : "MA",
        "street_1" : "123 Summer St",
        "street_2" : "apt. 1",
        "country" : "United States"
      },
      "service_type" : "plumber",
      "custom_fields" : {},
      "source_id" : 61,
      "source" : "account_35"
    },
    "appointment" : {
      "strategy" : "default",
      "window_start_time" : [
        "2015-12-30T09:00:00+00:00",
        "2015-12-31T09:00:00+00:00"
      ],
      "window_end_time" : [
        "2015-12-30T12:00:00+00:00",
        "2015-12-31T09:00:00+00:00"
      ]
    },
    "job_id" : null,
    "appointment_id" : null,
    "payer" : {
      "external_id" : "10001",
      "first_name" : "John-196",
      "last_name" : "Doe-178",
      "notes" : "Notes-202",
      "company_name" : "Company-202",
      "email" : "customer-193@example.com",
      "custom_fields" : {
        "key33" : "new value"
      },
      "phone_numbers" : [
        {
          "number" : "+15555550205",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "home_address" : {
        "latitude" : 0.13,
        "longitude" : -1.23,
        "postal_code" : "01234",
        "city" : "Boston",
        "state" : "MA",
        "street_1" : "123 Summer St",
        "street_2" : "apt. 1",
        "country" : "United States"
      },
      "billing_address" : {
        "latitude" : 0.13,
        "longitude" : -1.23,
        "postal_code" : "01234",
        "city" : "Boston",
        "state" : "MA",
        "street_1" : "123 Summer St",
        "street_2" : "apt. 1",
        "country" : "United States",
        "attention_to" : null,
        "company_name" : null
      }
    },
    "version" : "v1",
    "updated_by" : "account:3047eb5f-005b-45f4-ae05-c2efe3517ff6",
    "entities" : [
      {
        "id" : 288,
        "external_ids" : [
          "1A036"
        ],
        "type" : "organization",
        "options" : {
          "pay" : 150,
          "appointment" : null
        },
        "status_message" : null,
        "status" : "new",
        "customer_id" : null,
        "offered_at" : null,
        "expires_at" : null,
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 289,
        "external_ids" : [
          "4A036"
        ],
        "type" : "organization",
        "options" : {
          "pay" : 250,
          "foo" : "bar",
          "duration_algorithm" : null
        },
        "status_message" : null,
        "status" : "new",
        "customer_id" : null,
        "offered_at" : null,
        "expires_at" : null,
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 290,
        "external_ids" : [
          "2A036",
          "787878"
        ],
        "type" : "organization",
        "options" : {},
        "status_message" : null,
        "status" : "new",
        "customer_id" : null,
        "offered_at" : null,
        "expires_at" : null,
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 291,
        "external_ids" : [
          "123456"
        ],
        "type" : "organization",
        "options" : {
          "pay" : 250,
          "foo" : "bar",
          "duration_algorithm" : null
        },
        "status_message" : null,
        "status" : "new",
        "customer_id" : null,
        "offered_at" : null,
        "expires_at" : null,
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 290,
        "external_ids" : [
          "2A036",
          "787878"
        ],
        "type" : "organization",
        "options" : {},
        "status_message" : null,
        "status" : "new",
        "customer_id" : null,
        "offered_at" : null,
        "expires_at" : null,
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 287,
        "external_ids" : [],
        "type" : "organization",
        "options" : {},
        "status_message" : null,
        "status" : "new",
        "customer_id" : 213,
        "offered_at" : null,
        "expires_at" : null,
        "viewed_at" : null,
        "completed_at" : null
      }
    ]
  }
}

List job offers

Request

ROUTE
GET /v1/job_offers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

3228

BODY
{
  "job_offers" : [
    {
      "id" : 4,
      "account_id" : 66,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:07:51+0000",
      "updated_at" : "2016-02-09T16:07:51+0000",
      "customer" : {
        "email" : "customer-201@example.com",
        "notes" : "Notes-210",
        "last_name" : "Doe-186",
        "first_name" : "John-204",
        "company_name" : "Company-210",
        "phone_number" : "555-555-0213"
      },
      "job" : {
        "title" : "Job Title 147",
        "customer" : null,
        "description" : "Job Description 147",
        "service_type" : "plumber",
        "source_id" : 66,
        "source" : "account1"
      },
      "appointment" : {
        "time" : "2016-02-11T16:07:51+0000",
        "user" : null,
        "title" : "Title 105",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : null,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : []
    },
    {
      "id" : 3,
      "account_id" : 66,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:07:51+0000",
      "updated_at" : "2016-02-09T16:07:51+0000",
      "customer" : {
        "email" : "customer-200@example.com",
        "notes" : "Notes-209",
        "last_name" : "Doe-185",
        "first_name" : "John-203",
        "company_name" : "Company-209",
        "phone_number" : "555-555-0212"
      },
      "job" : {
        "title" : "Job Title 146",
        "customer" : null,
        "description" : "Job Description 146",
        "service_type" : "plumber",
        "source_id" : 66,
        "source" : "account1"
      },
      "appointment" : {
        "time" : "2016-02-11T16:07:51+0000",
        "user" : null,
        "title" : "Title 104",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : 144,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : []
    },
    {
      "id" : 2,
      "account_id" : 66,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:07:51+0000",
      "updated_at" : "2016-02-09T16:07:51+0000",
      "customer" : {
        "email" : "customer-199@example.com",
        "notes" : "Notes-208",
        "last_name" : "Doe-184",
        "first_name" : "John-202",
        "company_name" : "Company-208",
        "phone_number" : "555-555-0211"
      },
      "job" : {
        "title" : "Job Title 145",
        "customer" : null,
        "description" : "Job Description 145",
        "service_type" : "plumber",
        "source_id" : 66,
        "source" : "account1"
      },
      "appointment" : {
        "time" : "2016-02-11T16:07:51+0000",
        "user" : null,
        "title" : "Title 103",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : 144,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : [
        {
          "id" : 310,
          "external_ids" : [],
          "type" : "organization",
          "options" : {},
          "status_message" : null,
          "status" : "new",
          "customer_id" : null,
          "offered_at" : "2016-02-09T16:51:40.000+00:00",
          "expires_at" : null,
          "viewed_at" : null,
          "completed_at" : null
        },
        {
          "id" : 311,
          "external_ids" : [],
          "type" : "organization",
          "options" : {},
          "status_message" : null,
          "status" : "new",
          "customer_id" : null,
          "offered_at" : "2016-02-09T16:51:40.000+00:00",
          "expires_at" : null,
          "viewed_at" : null,
          "completed_at" : null
        }
      ]
    }
  ]
}

Update job offer

Request

ROUTE
PATCH /v1/job_offers/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "8"
}
BODY
{
  "status" : "canceled"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

981

BODY
{
  "job_offer" : {
    "id" : 8,
    "account_id" : 68,
    "status" : "canceled",
    "ui_options" : {},
    "acknowledge_only" : false,
    "offer_strategy" : "round_robin",
    "duration" : 3600,
    "duration_algorithm" : 1,
    "duration_algorithm_options" : {},
    "selection_strategy" : "given",
    "selection_options" : {},
    "expires_at" : "2016-02-09T16:51:40+0000",
    "completed_at" : null,
    "created_at" : "2016-02-09T16:07:52+0000",
    "updated_at" : "2016-02-09T16:07:52+0000",
    "customer" : {
      "email" : "customer-207@example.com",
      "notes" : "Notes-216",
      "last_name" : "Doe-192",
      "first_name" : "John-210",
      "company_name" : "Company-216",
      "phone_number" : "555-555-0219"
    },
    "job" : {
      "title" : "Job Title 153",
      "customer" : null,
      "description" : "Job Description 153",
      "service_type" : "plumber",
      "source_id" : 68,
      "source" : "account1"
    },
    "appointment" : {
      "time" : "2016-02-11T16:07:52+0000",
      "user" : null,
      "title" : "Title 109",
      "status" : "draft",
      "duration" : 3600,
      "strategy" : "manual"
    },
    "job_id" : null,
    "appointment_id" : null,
    "payer" : {},
    "version" : "v1",
    "updated_by" : "account:3fe5df8e-390f-4be9-a906-04602255bdee",
    "entities" : []
  }
}

Update job offer

Request

ROUTE
PATCH /v1/job_offers/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "9"
}
BODY
{
  "status" : "accepted"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

32

BODY
{
  "errors" : [
    "Permission Denied"
  ]
}

List job offers of organization

List of Job Offers for a given list of filters.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
filter[job_id_eq] optional Integer return Job Offers for given Job

Request

ROUTE
GET /v1/organizations/:organization_id/job_offers
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "organization_id" : "481"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4724

BODY
{
  "organization_job_offers" : [
    {
      "id" : 17,
      "account_id" : 117,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:08:21+0000",
      "updated_at" : "2016-02-09T16:08:21+0000",
      "customer" : {
        "email" : "customer-361@example.com",
        "notes" : "Notes-370",
        "last_name" : "Doe-337",
        "first_name" : "John-355",
        "company_name" : "Company-370",
        "phone_number" : "555-555-0364"
      },
      "job" : {
        "title" : "Job Title 251",
        "customer" : null,
        "description" : "Job Description 269",
        "service_type" : "plumber",
        "source_id" : 117,
        "source" : "account_42"
      },
      "appointment" : {
        "time" : "2016-02-11T16:08:21+0000",
        "user" : null,
        "title" : "Title 127",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : null,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : [
        {
          "id" : 481,
          "external_ids" : [],
          "type" : "organization",
          "options" : {},
          "status_message" : null,
          "status" : "offered",
          "customer_id" : null,
          "offered_at" : "2016-02-09T16:51:40.000+00:00",
          "expires_at" : "2016-02-10T16:08:21.000+00:00",
          "viewed_at" : null,
          "completed_at" : null
        }
      ]
    },
    {
      "id" : 18,
      "account_id" : 117,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:08:21+0000",
      "updated_at" : "2016-02-09T16:08:21+0000",
      "customer" : {
        "email" : "customer-362@example.com",
        "notes" : "Notes-371",
        "last_name" : "Doe-338",
        "first_name" : "John-356",
        "company_name" : "Company-371",
        "phone_number" : "555-555-0365"
      },
      "job" : {
        "title" : "Job Title 252",
        "customer" : null,
        "description" : "Job Description 270",
        "service_type" : "plumber",
        "source_id" : 117,
        "source" : "account_42"
      },
      "appointment" : {
        "time" : "2016-02-11T16:08:21+0000",
        "user" : null,
        "title" : "Title 128",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : null,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : [
        {
          "id" : 481,
          "external_ids" : [],
          "type" : "organization",
          "options" : {},
          "status_message" : null,
          "status" : "offered",
          "customer_id" : null,
          "offered_at" : "2016-02-09T16:51:40.000+00:00",
          "expires_at" : "2016-02-10T16:08:21.000+00:00",
          "viewed_at" : null,
          "completed_at" : null
        }
      ]
    },
    {
      "id" : 19,
      "account_id" : 117,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:08:22+0000",
      "updated_at" : "2016-02-09T16:08:22+0000",
      "customer" : {
        "email" : "customer-363@example.com",
        "notes" : "Notes-372",
        "last_name" : "Doe-339",
        "first_name" : "John-357",
        "company_name" : "Company-372",
        "phone_number" : "555-555-0366"
      },
      "job" : {
        "title" : "Job Title 253",
        "customer" : null,
        "description" : "Job Description 271",
        "service_type" : "plumber",
        "source_id" : 117,
        "source" : "account_42"
      },
      "appointment" : {
        "time" : "2016-02-11T16:08:22+0000",
        "user" : null,
        "title" : "Title 129",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : null,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : [
        {
          "id" : 481,
          "external_ids" : [],
          "type" : "organization",
          "options" : {},
          "status_message" : null,
          "status" : "rejected",
          "customer_id" : null,
          "offered_at" : "2016-02-09T16:51:40.000+00:00",
          "expires_at" : "2016-02-10T16:08:22.000+00:00",
          "viewed_at" : null,
          "completed_at" : null
        }
      ]
    },
    {
      "id" : 20,
      "account_id" : 117,
      "status" : "new",
      "ui_options" : {},
      "acknowledge_only" : false,
      "offer_strategy" : "round_robin",
      "duration" : 3600,
      "duration_algorithm" : 1,
      "duration_algorithm_options" : {},
      "selection_strategy" : "given",
      "selection_options" : {},
      "expires_at" : "2016-02-09T16:51:40+0000",
      "completed_at" : null,
      "created_at" : "2016-02-09T16:08:22+0000",
      "updated_at" : "2016-02-09T16:08:22+0000",
      "customer" : {
        "email" : "customer-364@example.com",
        "notes" : "Notes-373",
        "last_name" : "Doe-340",
        "first_name" : "John-358",
        "company_name" : "Company-373",
        "phone_number" : "555-555-0367"
      },
      "job" : {
        "title" : "Job Title 254",
        "customer" : null,
        "description" : "Job Description 272",
        "service_type" : "plumber",
        "source_id" : 117,
        "source" : "account_42"
      },
      "appointment" : {
        "time" : "2016-02-11T16:08:22+0000",
        "user" : null,
        "title" : "Title 130",
        "status" : "draft",
        "duration" : 3600,
        "strategy" : "manual"
      },
      "job_id" : null,
      "appointment_id" : null,
      "payer" : {},
      "version" : "v1",
      "updated_by" : "system",
      "entities" : [
        {
          "id" : 481,
          "external_ids" : [],
          "type" : "organization",
          "options" : {},
          "status_message" : null,
          "status" : "accepted",
          "customer_id" : null,
          "offered_at" : "2016-02-09T16:51:40.000+00:00",
          "expires_at" : null,
          "viewed_at" : null,
          "completed_at" : null
        }
      ]
    }
  ]
}

Update job offer of organization

Updates a Job Offer for a given set of parameters.

Parameters

Parameter Required Type Description
status required String Job offer status
status_message optional String Job offer status message

Request

ROUTE
PATCH /v1/organizations/:organization_id/job_offers/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "organization_id" : "505",
  "id" : "45"
}
BODY
{
  "status" : "accepted",
  "status_message" : "thanks"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

26

BODY
{
  "errors" : [
    "Unathorized"
  ]
}

Update job offer of organization

Updates a Job Offer for a given set of parameters.

Parameters

Parameter Required Type Description
status required String Job offer status
status_message optional String Job offer status message

Request

ROUTE
PATCH /v1/organizations/:organization_id/job_offers/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "organization_id" : "496",
  "id" : "42"
}
BODY
{
  "status" : "accepted",
  "status_message" : "thanks"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1509

BODY
{
  "job_offer" : {
    "id" : 42,
    "account_id" : 122,
    "status" : "new",
    "ui_options" : {},
    "acknowledge_only" : false,
    "offer_strategy" : "round_robin",
    "duration" : 3600,
    "duration_algorithm" : 1,
    "duration_algorithm_options" : {},
    "selection_strategy" : "given",
    "selection_options" : {},
    "expires_at" : "2016-02-09T16:51:40+0000",
    "completed_at" : null,
    "created_at" : "2016-02-09T16:08:23+0000",
    "updated_at" : "2016-02-09T16:08:24+0000",
    "customer" : {
      "email" : "customer-387@example.com",
      "notes" : "Notes-396",
      "last_name" : "Doe-363",
      "first_name" : "John-381",
      "company_name" : "Company-396",
      "phone_number" : "555-555-0390"
    },
    "job" : {
      "title" : "Job Title 277",
      "customer" : null,
      "description" : "Job Description 295",
      "service_type" : "plumber",
      "source_id" : 122,
      "source" : "account1"
    },
    "appointment" : {
      "time" : "2016-02-11T16:08:23+0000",
      "user" : null,
      "title" : "Title 152",
      "status" : "draft",
      "duration" : 3600,
      "strategy" : "manual"
    },
    "job_id" : 299,
    "appointment_id" : null,
    "payer" : {},
    "version" : "v1",
    "updated_by" : "user:ef0b90cc-2940-4067-932b-7b365e040888",
    "entities" : [
      {
        "id" : 496,
        "external_ids" : [],
        "type" : "organization",
        "options" : {},
        "status_message" : null,
        "status" : "rejected",
        "customer_id" : null,
        "offered_at" : "2016-02-09T16:51:40.000+00:00",
        "expires_at" : "2016-02-10T16:08:23.000+00:00",
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 496,
        "external_ids" : [],
        "type" : "organization",
        "options" : {},
        "status_message" : "thanks",
        "status" : "accepted",
        "customer_id" : null,
        "offered_at" : "2016-02-09T16:51:40.000+00:00",
        "expires_at" : "2016-02-10T16:08:23.000+00:00",
        "viewed_at" : null,
        "completed_at" : "2016-02-09T16:08:24.000+00:00"
      }
    ]
  }
}

Update job offer of organization

Updates a Job Offer for a given set of parameters.

Parameters

Parameter Required Type Description
status required String Job offer status
status_message optional String Job offer status message

Request

ROUTE
PATCH /v1/organizations/:organization_id/job_offers/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "organization_id" : "499",
  "id" : "43"
}
BODY
{
  "status" : "rejected",
  "status_message" : "thanks"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1509

BODY
{
  "job_offer" : {
    "id" : 43,
    "account_id" : 124,
    "status" : "new",
    "ui_options" : {},
    "acknowledge_only" : false,
    "offer_strategy" : "round_robin",
    "duration" : 3600,
    "duration_algorithm" : 1,
    "duration_algorithm_options" : {},
    "selection_strategy" : "given",
    "selection_options" : {},
    "expires_at" : "2016-02-09T16:51:40+0000",
    "completed_at" : null,
    "created_at" : "2016-02-09T16:08:24+0000",
    "updated_at" : "2016-02-09T16:08:24+0000",
    "customer" : {
      "email" : "customer-389@example.com",
      "notes" : "Notes-398",
      "last_name" : "Doe-365",
      "first_name" : "John-383",
      "company_name" : "Company-398",
      "phone_number" : "555-555-0392"
    },
    "job" : {
      "title" : "Job Title 279",
      "customer" : null,
      "description" : "Job Description 297",
      "service_type" : "plumber",
      "source_id" : 124,
      "source" : "account1"
    },
    "appointment" : {
      "time" : "2016-02-11T16:08:24+0000",
      "user" : null,
      "title" : "Title 153",
      "status" : "draft",
      "duration" : 3600,
      "strategy" : "manual"
    },
    "job_id" : 300,
    "appointment_id" : null,
    "payer" : {},
    "version" : "v1",
    "updated_by" : "user:260d62c8-b5bb-4301-9852-e3534649a9e1",
    "entities" : [
      {
        "id" : 499,
        "external_ids" : [],
        "type" : "organization",
        "options" : {},
        "status_message" : null,
        "status" : "rejected",
        "customer_id" : null,
        "offered_at" : "2016-02-09T16:51:40.000+00:00",
        "expires_at" : "2016-02-10T16:08:24.000+00:00",
        "viewed_at" : null,
        "completed_at" : null
      },
      {
        "id" : 499,
        "external_ids" : [],
        "type" : "organization",
        "options" : {},
        "status_message" : "thanks",
        "status" : "rejected",
        "customer_id" : null,
        "offered_at" : "2016-02-09T16:51:40.000+00:00",
        "expires_at" : "2016-02-10T16:08:24.000+00:00",
        "viewed_at" : null,
        "completed_at" : "2016-02-09T16:08:24.000+00:00"
      }
    ]
  }
}

Job

Create job

Creates a Job for a given set of parameters

Parameters

Parameter Required Type Description
organization_id required Integer ID of an Organization assigned to a job
customer_id required Integer ID of a Customer assigned to a job
address required Hash Hash of address for this job
street_1 required String Street Address
street_2 optional String Apt, Floor, Office, etc.
postal_code required String Zip Code
city required String City
state required String Two letter abbreviation of the US State name
country required String Country.
allowed values: 'United States', 'Canada', 'United Kingdom', 'World'
latitude required Integer Latitude of the location
longitude required Integer Longitude of the location
source optional String Job source, used to distinguish where from job came, for example
one of aggregators. This parameter becomes read-only after creation.
title optional String Short description of a job
description optional Text Long description of a job
service_type required String Service type key from Organization. Must match existing key.
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity
brand_id optional Integer Custom Brand settings for this Job

Request

ROUTE
POST /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 342,
  "title" : "Toilet flooding",
  "description" : "in the\nbasement",
  "source" : "phone_call",
  "address" : {
    "latitude" : 0.13,
    "longitude" : -1.23,
    "postal_code" : "01234",
    "city" : "Boston",
    "state" : "MA",
    "street_1" : "123 Summer St",
    "street_2" : "apt. 1"
  },
  "customer_id" : 229,
  "service_type" : "plumber",
  "brand_id" : 8,
  "source_id" : 77,
  "external_ids" : [
    "qb:10001",
    "qb:10002"
  ],
  "labels" : [
    {
      "label_id" : 2
    },
    {
      "label_id" : 1
    },
    {
      "label_id" : 3
    },
    {
      "date" : "2016-01-11T12:39:13+00:00",
      "color" : "#000000",
      "title" : "My cool label"
    },
    {
      "date" : "2016-01-11T12:39:13+00:00",
      "color" : "#FF0000",
      "title" : "My cool label 2",
      "organization_id" : 343
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1783

BODY
{
  "job" : {
    "id" : 155,
    "organization_id" : 342,
    "title" : "Toilet flooding",
    "status" : "unscheduled",
    "status_message" : null,
    "resume_at" : null,
    "description" : "in the\nbasement",
    "created_at" : "2016-02-09T16:07:55+0000",
    "updated_at" : "2016-02-09T16:07:55+0000",
    "service_type" : "plumber",
    "custom_fields" : {},
    "customer_id" : 229,
    "brand_id" : 8,
    "source" : "phone_call",
    "uid" : "8a97a27e-0995-4868-afef-948c21f28570",
    "source_id" : 77,
    "labels" : [
      {
        "label_id" : 1,
        "date" : null,
        "color" : "#AA0000",
        "title" : "Label 1"
      },
      {
        "label_id" : 2,
        "date" : null,
        "color" : null,
        "title" : "Label 2"
      },
      {
        "label_id" : 3,
        "date" : null,
        "color" : null,
        "title" : "Label 3"
      },
      {
        "label_id" : 4,
        "date" : "2016-01-11T12:39:13+0000",
        "color" : "#000000",
        "title" : "My cool label"
      },
      {
        "label_id" : 5,
        "date" : "2016-01-11T12:39:13+0000",
        "color" : "#FF0000",
        "title" : "My cool label 2"
      }
    ],
    "version" : "v1",
    "updated_by" : "user:c35a9016-e327-4cde-8c7a-46800191f783",
    "external_ids" : [
      "qb:10001",
      "qb:10002"
    ],
    "address" : {
      "id" : 1054,
      "addressable_id" : 155,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt. 1",
      "postal_code" : "01234",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 0.13,
      "longitude" : -1.23,
      "created_at" : "2016-02-09T16:07:55+0000",
      "updated_at" : "2016-02-09T16:07:55+0000",
      "version" : "v1",
      "updated_by" : "user:c35a9016-e327-4cde-8c7a-46800191f783"
    },
    "customer" : {
      "id" : 229,
      "organization_id" : 342,
      "first_name" : "John-227",
      "last_name" : "Doe-209",
      "full_name" : "John-227 Doe-209",
      "company_name" : "Company-233",
      "email" : "customer-224@example.com",
      "phone_number" : "+15555550236",
      "phone_numbers" : {
        "+15555550236" : {
          "type" : "Mobile",
          "number" : "+15555550236",
          "primary" : true
        }
      },
      "notes" : "Notes-233",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:07:55+0000",
      "updated_at" : "2016-02-09T16:07:55+0000",
      "home_address" : null,
      "billing_address" : null,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  }
}

Filter jobs by address

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "address_address_cache_cont" : "avenue"
  },
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4024

BODY
{
  "jobs" : [
    {
      "id" : 229,
      "organization_id" : 377,
      "title" : "Job Title 223",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 241",
      "created_at" : "2016-02-09T16:08:05+0000",
      "updated_at" : "2016-02-09T16:08:05+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 299,
      "brand_id" : null,
      "source" : null,
      "uid" : "8f81209e-d82f-4f05-910d-74e324787c89",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1268,
        "addressable_id" : 229,
        "addressable_type" : "Job",
        "street_1" : "2nd Avenue",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:05+0000",
        "updated_at" : "2016-02-09T16:08:05+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 299,
        "organization_id" : 377,
        "first_name" : "John-288",
        "last_name" : "Doe-270",
        "full_name" : "John-288 Doe-270",
        "company_name" : "Company-303",
        "email" : "customer-294@example.com",
        "phone_number" : "+15555550297",
        "phone_numbers" : {
          "+15555550297" : {
            "type" : "Mobile",
            "number" : "+15555550297",
            "primary" : true
          }
        },
        "notes" : "Notes-303",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:05+0000",
        "updated_at" : "2016-02-09T16:08:05+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:05+0000",
          "updated_at" : "2016-02-09T16:08:05+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:05+0000",
          "updated_at" : "2016-02-09T16:08:05+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 228,
      "organization_id" : 377,
      "title" : "Job Title 222",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 240",
      "created_at" : "2016-02-09T16:08:05+0000",
      "updated_at" : "2016-02-09T16:08:05+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 299,
      "brand_id" : null,
      "source" : null,
      "uid" : "50557441-9d4e-4741-a0e1-7e90a99ebfb6",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1265,
        "addressable_id" : 228,
        "addressable_type" : "Job",
        "street_1" : "1st Avenue",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:05+0000",
        "updated_at" : "2016-02-09T16:08:05+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 299,
        "organization_id" : 377,
        "first_name" : "John-288",
        "last_name" : "Doe-270",
        "full_name" : "John-288 Doe-270",
        "company_name" : "Company-303",
        "email" : "customer-294@example.com",
        "phone_number" : "+15555550297",
        "phone_numbers" : {
          "+15555550297" : {
            "type" : "Mobile",
            "number" : "+15555550297",
            "primary" : true
          }
        },
        "notes" : "Notes-303",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:05+0000",
        "updated_at" : "2016-02-09T16:08:05+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:05+0000",
          "updated_at" : "2016-02-09T16:08:05+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:05+0000",
          "updated_at" : "2016-02-09T16:08:05+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by customer IDs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "customer_id_in" : [
      "275",
      "276"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

5974

BODY
{
  "jobs" : [
    {
      "id" : 204,
      "organization_id" : 369,
      "title" : "Job Title 216",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 216",
      "created_at" : "2016-02-09T16:08:02+0000",
      "updated_at" : "2016-02-09T16:08:02+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 276,
      "brand_id" : null,
      "source" : null,
      "uid" : "fb6496e9-4ab8-4de1-88f3-4c0ef217c304",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1197,
        "addressable_id" : 204,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:02+0000",
        "updated_at" : "2016-02-09T16:08:02+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 276,
        "organization_id" : 369,
        "first_name" : "bc",
        "last_name" : "de",
        "full_name" : "bc de",
        "company_name" : "Company-280",
        "email" : "customer-271@example.com",
        "phone_number" : "+15559991122",
        "phone_numbers" : {
          "+15559991122" : {
            "type" : "Mobile",
            "number" : "+15559991122",
            "primary" : true
          }
        },
        "notes" : "Notes-280",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:02+0000",
        "updated_at" : "2016-02-09T16:08:02+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:02+0000",
          "updated_at" : "2016-02-09T16:08:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:02+0000",
          "updated_at" : "2016-02-09T16:08:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 203,
      "organization_id" : 369,
      "title" : "Job Title 215",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 215",
      "created_at" : "2016-02-09T16:08:02+0000",
      "updated_at" : "2016-02-09T16:08:02+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 275,
      "brand_id" : null,
      "source" : null,
      "uid" : "5e98731a-dd2d-4827-a1c1-cae27626fb03",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1194,
        "addressable_id" : 203,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:02+0000",
        "updated_at" : "2016-02-09T16:08:02+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 275,
        "organization_id" : 369,
        "first_name" : "ab",
        "last_name" : "bc",
        "full_name" : "ab bc",
        "company_name" : "Company-279",
        "email" : "customer-270@example.com",
        "phone_number" : "+15559991111",
        "phone_numbers" : {
          "+15559991111" : {
            "type" : "Mobile",
            "number" : "+15559991111",
            "primary" : true
          }
        },
        "notes" : "Notes-279",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:02+0000",
        "updated_at" : "2016-02-09T16:08:02+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:02+0000",
          "updated_at" : "2016-02-09T16:08:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:02+0000",
          "updated_at" : "2016-02-09T16:08:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 202,
      "organization_id" : 369,
      "title" : "Job Title 214",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 214",
      "created_at" : "2016-02-09T16:08:02+0000",
      "updated_at" : "2016-02-09T16:08:02+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 275,
      "brand_id" : null,
      "source" : null,
      "uid" : "1874f1c6-dcaf-4a7e-b975-ba06d3d5a261",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1193,
        "addressable_id" : 202,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:02+0000",
        "updated_at" : "2016-02-09T16:08:02+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 275,
        "organization_id" : 369,
        "first_name" : "ab",
        "last_name" : "bc",
        "full_name" : "ab bc",
        "company_name" : "Company-279",
        "email" : "customer-270@example.com",
        "phone_number" : "+15559991111",
        "phone_numbers" : {
          "+15559991111" : {
            "type" : "Mobile",
            "number" : "+15559991111",
            "primary" : true
          }
        },
        "notes" : "Notes-279",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:02+0000",
        "updated_at" : "2016-02-09T16:08:02+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:02+0000",
          "updated_at" : "2016-02-09T16:08:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:02+0000",
          "updated_at" : "2016-02-09T16:08:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by customer name

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "customer_full_name_cont" : "bc"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

5974

BODY
{
  "jobs" : [
    {
      "id" : 208,
      "organization_id" : 370,
      "title" : "Job Title 220",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 220",
      "created_at" : "2016-02-09T16:08:03+0000",
      "updated_at" : "2016-02-09T16:08:03+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 279,
      "brand_id" : null,
      "source" : null,
      "uid" : "d50469b7-51b2-4421-955c-a72ea3f047ef",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1207,
        "addressable_id" : 208,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 279,
        "organization_id" : 370,
        "first_name" : "bc",
        "last_name" : "de",
        "full_name" : "bc de",
        "company_name" : "Company-283",
        "email" : "customer-274@example.com",
        "phone_number" : "+15559991122",
        "phone_numbers" : {
          "+15559991122" : {
            "type" : "Mobile",
            "number" : "+15559991122",
            "primary" : true
          }
        },
        "notes" : "Notes-283",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 207,
      "organization_id" : 370,
      "title" : "Job Title 219",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 219",
      "created_at" : "2016-02-09T16:08:03+0000",
      "updated_at" : "2016-02-09T16:08:03+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 278,
      "brand_id" : null,
      "source" : null,
      "uid" : "9325c424-aa40-463f-ad3e-c1fc4502a7c4",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1204,
        "addressable_id" : 207,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 278,
        "organization_id" : 370,
        "first_name" : "ab",
        "last_name" : "bc",
        "full_name" : "ab bc",
        "company_name" : "Company-282",
        "email" : "customer-273@example.com",
        "phone_number" : "+15559991111",
        "phone_numbers" : {
          "+15559991111" : {
            "type" : "Mobile",
            "number" : "+15559991111",
            "primary" : true
          }
        },
        "notes" : "Notes-282",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 206,
      "organization_id" : 370,
      "title" : "Job Title 218",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 218",
      "created_at" : "2016-02-09T16:08:03+0000",
      "updated_at" : "2016-02-09T16:08:03+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 278,
      "brand_id" : null,
      "source" : null,
      "uid" : "0fb3f31d-04af-48c9-bf9a-a8c6f83fce15",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1203,
        "addressable_id" : 206,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 278,
        "organization_id" : 370,
        "first_name" : "ab",
        "last_name" : "bc",
        "full_name" : "ab bc",
        "company_name" : "Company-282",
        "email" : "customer-273@example.com",
        "phone_number" : "+15559991111",
        "phone_numbers" : {
          "+15559991111" : {
            "type" : "Mobile",
            "number" : "+15559991111",
            "primary" : true
          }
        },
        "notes" : "Notes-282",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by external ids

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "external_ids_as_text_cont" : "qb:300"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2029

BODY
{
  "jobs" : [
    {
      "id" : 216,
      "organization_id" : 373,
      "title" : "abc",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 228",
      "created_at" : "2016-02-09T16:08:04+0000",
      "updated_at" : "2016-02-09T16:08:04+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 287,
      "brand_id" : null,
      "source" : null,
      "uid" : "478a427c-a037-4192-81f9-9a5387beb0dc",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:1001",
        "qb:3001"
      ],
      "address" : {
        "id" : 1229,
        "addressable_id" : 216,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:04+0000",
        "updated_at" : "2016-02-09T16:08:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 287,
        "organization_id" : 373,
        "first_name" : "John-276",
        "last_name" : "Doe-258",
        "full_name" : "John-276 Doe-258",
        "company_name" : "Company-291",
        "email" : "customer-282@example.com",
        "phone_number" : "+15555550285",
        "phone_numbers" : {
          "+15555550285" : {
            "type" : "Mobile",
            "number" : "+15555550285",
            "primary" : true
          }
        },
        "notes" : "Notes-291",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:04+0000",
        "updated_at" : "2016-02-09T16:08:04+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:04+0000",
          "updated_at" : "2016-02-09T16:08:04+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:04+0000",
          "updated_at" : "2016-02-09T16:08:04+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by external ids

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "external_ids_contains" : [
      "qb:1002"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2019

BODY
{
  "jobs" : [
    {
      "id" : 214,
      "organization_id" : 372,
      "title" : "bcd",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 226",
      "created_at" : "2016-02-09T16:08:04+0000",
      "updated_at" : "2016-02-09T16:08:04+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 285,
      "brand_id" : null,
      "source" : null,
      "uid" : "66bb3ea5-d715-4ded-b5e0-3f1e123b1b48",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [
        "qb:1002"
      ],
      "address" : {
        "id" : 1223,
        "addressable_id" : 214,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:04+0000",
        "updated_at" : "2016-02-09T16:08:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 285,
        "organization_id" : 372,
        "first_name" : "John-274",
        "last_name" : "Doe-256",
        "full_name" : "John-274 Doe-256",
        "company_name" : "Company-289",
        "email" : "customer-280@example.com",
        "phone_number" : "+15555550283",
        "phone_numbers" : {
          "+15555550283" : {
            "type" : "Mobile",
            "number" : "+15555550283",
            "primary" : true
          }
        },
        "notes" : "Notes-289",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:04+0000",
        "updated_at" : "2016-02-09T16:08:04+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:04+0000",
          "updated_at" : "2016-02-09T16:08:04+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:04+0000",
          "updated_at" : "2016-02-09T16:08:04+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by multiple IDs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "id_in" : [
      "174",
      "175"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4148

BODY
{
  "jobs" : [
    {
      "id" : 175,
      "organization_id" : 358,
      "title" : "Job Title 187",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 187",
      "created_at" : "2016-02-09T16:07:58+0000",
      "updated_at" : "2016-02-09T16:07:58+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 249,
      "brand_id" : null,
      "source" : null,
      "uid" : "94c92a4f-547f-417b-af8d-2afac494e152",
      "source_id" : null,
      "labels" : [
        {
          "label_id" : 21,
          "date" : null,
          "color" : null,
          "title" : "Label 16"
        }
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1111,
        "addressable_id" : 175,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 249,
        "organization_id" : 358,
        "first_name" : "John-247",
        "last_name" : "Doe-229",
        "full_name" : "John-247 Doe-229",
        "company_name" : "Company-253",
        "email" : "customer-244@example.com",
        "phone_number" : "+15555550256",
        "phone_numbers" : {
          "+15555550256" : {
            "type" : "Mobile",
            "number" : "+15555550256",
            "primary" : true
          }
        },
        "notes" : "Notes-253",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 174,
      "organization_id" : 358,
      "title" : "Job Title 186",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 186",
      "created_at" : "2016-02-09T16:07:58+0000",
      "updated_at" : "2016-02-09T16:07:58+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 248,
      "brand_id" : null,
      "source" : null,
      "uid" : "d55da82e-8291-4b73-b791-2c79ded2624d",
      "source_id" : null,
      "labels" : [
        {
          "label_id" : 20,
          "date" : null,
          "color" : null,
          "title" : "Label 15"
        }
      ],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1108,
        "addressable_id" : 174,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 248,
        "organization_id" : 358,
        "first_name" : "John-246",
        "last_name" : "Doe-228",
        "full_name" : "John-246 Doe-228",
        "company_name" : "Company-252",
        "email" : "customer-243@example.com",
        "phone_number" : "+15555550255",
        "phone_numbers" : {
          "+15555550255" : {
            "type" : "Mobile",
            "number" : "+15555550255",
            "primary" : true
          }
        },
        "notes" : "Notes-252",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by organization IDs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "organization_id_eq" : "362"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4030

BODY
{
  "jobs" : [
    {
      "id" : 187,
      "organization_id" : 362,
      "title" : "Job Title 199",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 199",
      "created_at" : "2016-02-09T16:08:00+0000",
      "updated_at" : "2016-02-09T16:08:00+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 261,
      "brand_id" : null,
      "source" : null,
      "uid" : "9b48a1f2-bda3-41d6-bf6a-386b818f8ed0",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1147,
        "addressable_id" : 187,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:00+0000",
        "updated_at" : "2016-02-09T16:08:00+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 261,
        "organization_id" : 362,
        "first_name" : "John-259",
        "last_name" : "Doe-241",
        "full_name" : "John-259 Doe-241",
        "company_name" : "Company-265",
        "email" : "customer-256@example.com",
        "phone_number" : "+15555550268",
        "phone_numbers" : {
          "+15555550268" : {
            "type" : "Mobile",
            "number" : "+15555550268",
            "primary" : true
          }
        },
        "notes" : "Notes-265",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:00+0000",
        "updated_at" : "2016-02-09T16:08:00+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:00+0000",
          "updated_at" : "2016-02-09T16:08:00+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:00+0000",
          "updated_at" : "2016-02-09T16:08:00+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 186,
      "organization_id" : 362,
      "title" : "Job Title 198",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 198",
      "created_at" : "2016-02-09T16:08:00+0000",
      "updated_at" : "2016-02-09T16:08:00+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 260,
      "brand_id" : null,
      "source" : null,
      "uid" : "e4388446-7470-4417-b450-3af7253ddd0c",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1144,
        "addressable_id" : 186,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:00+0000",
        "updated_at" : "2016-02-09T16:08:00+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 260,
        "organization_id" : 362,
        "first_name" : "John-258",
        "last_name" : "Doe-240",
        "full_name" : "John-258 Doe-240",
        "company_name" : "Company-264",
        "email" : "customer-255@example.com",
        "phone_number" : "+15555550267",
        "phone_numbers" : {
          "+15555550267" : {
            "type" : "Mobile",
            "number" : "+15555550267",
            "primary" : true
          }
        },
        "notes" : "Notes-264",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:00+0000",
        "updated_at" : "2016-02-09T16:08:00+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:00+0000",
          "updated_at" : "2016-02-09T16:08:00+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:00+0000",
          "updated_at" : "2016-02-09T16:08:00+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by status

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "service_type_in" : [
      "plumber",
      "electrician"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

6044

BODY
{
  "jobs" : [
    {
      "id" : 245,
      "organization_id" : 381,
      "title" : "Job Title 239",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 257",
      "created_at" : "2016-02-09T16:08:07+0000",
      "updated_at" : "2016-02-09T16:08:07+0000",
      "service_type" : "electrician",
      "custom_fields" : {},
      "customer_id" : 314,
      "brand_id" : null,
      "source" : null,
      "uid" : "a4d58396-bc59-4799-9c27-bead0d5b51f4",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1312,
        "addressable_id" : 245,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 314,
        "organization_id" : 381,
        "first_name" : "John-303",
        "last_name" : "Doe-285",
        "full_name" : "John-303 Doe-285",
        "company_name" : "Company-318",
        "email" : "customer-309@example.com",
        "phone_number" : "+15555550312",
        "phone_numbers" : {
          "+15555550312" : {
            "type" : "Mobile",
            "number" : "+15555550312",
            "primary" : true
          }
        },
        "notes" : "Notes-318",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:07+0000",
          "updated_at" : "2016-02-09T16:08:07+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:07+0000",
          "updated_at" : "2016-02-09T16:08:07+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 244,
      "organization_id" : 381,
      "title" : "Job Title 238",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 256",
      "created_at" : "2016-02-09T16:08:07+0000",
      "updated_at" : "2016-02-09T16:08:07+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 313,
      "brand_id" : null,
      "source" : null,
      "uid" : "f7cc164c-cc52-46d5-86d6-247d2e495f8a",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1309,
        "addressable_id" : 244,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 313,
        "organization_id" : 381,
        "first_name" : "John-302",
        "last_name" : "Doe-284",
        "full_name" : "John-302 Doe-284",
        "company_name" : "Company-317",
        "email" : "customer-308@example.com",
        "phone_number" : "+15555550311",
        "phone_numbers" : {
          "+15555550311" : {
            "type" : "Mobile",
            "number" : "+15555550311",
            "primary" : true
          }
        },
        "notes" : "Notes-317",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:07+0000",
          "updated_at" : "2016-02-09T16:08:07+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:07+0000",
          "updated_at" : "2016-02-09T16:08:07+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 243,
      "organization_id" : 381,
      "title" : "Job Title 237",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 255",
      "created_at" : "2016-02-09T16:08:07+0000",
      "updated_at" : "2016-02-09T16:08:07+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 312,
      "brand_id" : null,
      "source" : null,
      "uid" : "80d7aa6c-3bc3-4d2a-9323-e80123edd655",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1306,
        "addressable_id" : 243,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 312,
        "organization_id" : 381,
        "first_name" : "John-301",
        "last_name" : "Doe-283",
        "full_name" : "John-301 Doe-283",
        "company_name" : "Company-316",
        "email" : "customer-307@example.com",
        "phone_number" : "+15555550310",
        "phone_numbers" : {
          "+15555550310" : {
            "type" : "Mobile",
            "number" : "+15555550310",
            "primary" : true
          }
        },
        "notes" : "Notes-316",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:07+0000",
          "updated_at" : "2016-02-09T16:08:07+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:07+0000",
          "updated_at" : "2016-02-09T16:08:07+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by statuses

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "status_in" : [
      "in_progress",
      "scheduled"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

6038

BODY
{
  "jobs" : [
    {
      "id" : 237,
      "organization_id" : 379,
      "title" : "Job Title 231",
      "status" : "scheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 249",
      "created_at" : "2016-02-09T16:08:06+0000",
      "updated_at" : "2016-02-09T16:08:06+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 306,
      "brand_id" : null,
      "source" : null,
      "uid" : "bee7df4e-3b5a-4324-89f3-71287985f5d1",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1288,
        "addressable_id" : 237,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:06+0000",
        "updated_at" : "2016-02-09T16:08:06+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 306,
        "organization_id" : 379,
        "first_name" : "John-295",
        "last_name" : "Doe-277",
        "full_name" : "John-295 Doe-277",
        "company_name" : "Company-310",
        "email" : "customer-301@example.com",
        "phone_number" : "+15555550304",
        "phone_numbers" : {
          "+15555550304" : {
            "type" : "Mobile",
            "number" : "+15555550304",
            "primary" : true
          }
        },
        "notes" : "Notes-310",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:06+0000",
        "updated_at" : "2016-02-09T16:08:06+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:06+0000",
          "updated_at" : "2016-02-09T16:08:06+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:06+0000",
          "updated_at" : "2016-02-09T16:08:06+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 236,
      "organization_id" : 379,
      "title" : "Job Title 230",
      "status" : "in_progress",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 248",
      "created_at" : "2016-02-09T16:08:06+0000",
      "updated_at" : "2016-02-09T16:08:06+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 305,
      "brand_id" : null,
      "source" : null,
      "uid" : "712cd256-5bd5-467b-a2e6-8b4f86af64d0",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1285,
        "addressable_id" : 236,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:06+0000",
        "updated_at" : "2016-02-09T16:08:06+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 305,
        "organization_id" : 379,
        "first_name" : "John-294",
        "last_name" : "Doe-276",
        "full_name" : "John-294 Doe-276",
        "company_name" : "Company-309",
        "email" : "customer-300@example.com",
        "phone_number" : "+15555550303",
        "phone_numbers" : {
          "+15555550303" : {
            "type" : "Mobile",
            "number" : "+15555550303",
            "primary" : true
          }
        },
        "notes" : "Notes-309",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:06+0000",
        "updated_at" : "2016-02-09T16:08:06+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:06+0000",
          "updated_at" : "2016-02-09T16:08:06+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:06+0000",
          "updated_at" : "2016-02-09T16:08:06+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 235,
      "organization_id" : 379,
      "title" : "Job Title 229",
      "status" : "in_progress",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 247",
      "created_at" : "2016-02-09T16:08:06+0000",
      "updated_at" : "2016-02-09T16:08:06+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 304,
      "brand_id" : null,
      "source" : null,
      "uid" : "2899dbc1-23a2-47ac-a36a-04288118101f",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1282,
        "addressable_id" : 235,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:06+0000",
        "updated_at" : "2016-02-09T16:08:06+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 304,
        "organization_id" : 379,
        "first_name" : "John-293",
        "last_name" : "Doe-275",
        "full_name" : "John-293 Doe-275",
        "company_name" : "Company-308",
        "email" : "customer-299@example.com",
        "phone_number" : "+15555550302",
        "phone_numbers" : {
          "+15555550302" : {
            "type" : "Mobile",
            "number" : "+15555550302",
            "primary" : true
          }
        },
        "notes" : "Notes-308",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:06+0000",
        "updated_at" : "2016-02-09T16:08:06+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:06+0000",
          "updated_at" : "2016-02-09T16:08:06+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:06+0000",
          "updated_at" : "2016-02-09T16:08:06+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by title

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "title_cont" : "b"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4010

BODY
{
  "jobs" : [
    {
      "id" : 211,
      "organization_id" : 371,
      "title" : "bcd",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 223",
      "created_at" : "2016-02-09T16:08:03+0000",
      "updated_at" : "2016-02-09T16:08:03+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 282,
      "brand_id" : null,
      "source" : null,
      "uid" : "c575f83e-4034-4cdf-9965-f867bc75153c",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1214,
        "addressable_id" : 211,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 282,
        "organization_id" : 371,
        "first_name" : "John-271",
        "last_name" : "Doe-253",
        "full_name" : "John-271 Doe-253",
        "company_name" : "Company-286",
        "email" : "customer-277@example.com",
        "phone_number" : "+15555550280",
        "phone_numbers" : {
          "+15555550280" : {
            "type" : "Mobile",
            "number" : "+15555550280",
            "primary" : true
          }
        },
        "notes" : "Notes-286",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 210,
      "organization_id" : 371,
      "title" : "abc",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 222",
      "created_at" : "2016-02-09T16:08:03+0000",
      "updated_at" : "2016-02-09T16:08:03+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 281,
      "brand_id" : null,
      "source" : null,
      "uid" : "48bc9862-a71c-44f4-bba2-cf28f7c9952f",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1211,
        "addressable_id" : 210,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 281,
        "organization_id" : 371,
        "first_name" : "John-270",
        "last_name" : "Doe-252",
        "full_name" : "John-270 Doe-252",
        "company_name" : "Company-285",
        "email" : "customer-276@example.com",
        "phone_number" : "+15555550279",
        "phone_numbers" : {
          "+15555550279" : {
            "type" : "Mobile",
            "number" : "+15555550279",
            "primary" : true
          }
        },
        "notes" : "Notes-285",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:03+0000",
        "updated_at" : "2016-02-09T16:08:03+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:03+0000",
          "updated_at" : "2016-02-09T16:08:03+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by user IDs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "users_id_in" : [
      "352",
      "353"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4030

BODY
{
  "jobs" : [
    {
      "id" : 193,
      "organization_id" : 366,
      "title" : "Job Title 205",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 205",
      "created_at" : "2016-02-09T16:08:01+0000",
      "updated_at" : "2016-02-09T16:08:01+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 267,
      "brand_id" : null,
      "source" : null,
      "uid" : "b298a6fe-40b5-4ba7-9ddc-435c8fed5a71",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1166,
        "addressable_id" : 193,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 267,
        "organization_id" : 366,
        "first_name" : "John-265",
        "last_name" : "Doe-247",
        "full_name" : "John-265 Doe-247",
        "company_name" : "Company-271",
        "email" : "customer-262@example.com",
        "phone_number" : "+15555550274",
        "phone_numbers" : {
          "+15555550274" : {
            "type" : "Mobile",
            "number" : "+15555550274",
            "primary" : true
          }
        },
        "notes" : "Notes-271",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 192,
      "organization_id" : 366,
      "title" : "Job Title 204",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 204",
      "created_at" : "2016-02-09T16:08:01+0000",
      "updated_at" : "2016-02-09T16:08:01+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 266,
      "brand_id" : null,
      "source" : null,
      "uid" : "5ab569ff-72bd-4311-b2dc-5cb3aacbfdc8",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1163,
        "addressable_id" : 192,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 266,
        "organization_id" : 366,
        "first_name" : "John-264",
        "last_name" : "Doe-246",
        "full_name" : "John-264 Doe-246",
        "company_name" : "Company-270",
        "email" : "customer-261@example.com",
        "phone_number" : "+15555550273",
        "phone_numbers" : {
          "+15555550273" : {
            "type" : "Mobile",
            "number" : "+15555550273",
            "primary" : true
          }
        },
        "notes" : "Notes-270",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Filter jobs by user name

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "users_full_name_cont" : "bc"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4030

BODY
{
  "jobs" : [
    {
      "id" : 196,
      "organization_id" : 367,
      "title" : "Job Title 208",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 208",
      "created_at" : "2016-02-09T16:08:01+0000",
      "updated_at" : "2016-02-09T16:08:01+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 270,
      "brand_id" : null,
      "source" : null,
      "uid" : "1915857e-f3fa-4054-8cd1-4a69ad33229f",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1175,
        "addressable_id" : 196,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 270,
        "organization_id" : 367,
        "first_name" : "John-268",
        "last_name" : "Doe-250",
        "full_name" : "John-268 Doe-250",
        "company_name" : "Company-274",
        "email" : "customer-265@example.com",
        "phone_number" : "+15555550277",
        "phone_numbers" : {
          "+15555550277" : {
            "type" : "Mobile",
            "number" : "+15555550277",
            "primary" : true
          }
        },
        "notes" : "Notes-274",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 195,
      "organization_id" : 367,
      "title" : "Job Title 207",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 207",
      "created_at" : "2016-02-09T16:08:01+0000",
      "updated_at" : "2016-02-09T16:08:01+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 269,
      "brand_id" : null,
      "source" : null,
      "uid" : "2a29cb2a-ca40-44b5-9b54-837b671ea33b",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1172,
        "addressable_id" : 195,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 269,
        "organization_id" : 367,
        "first_name" : "John-267",
        "last_name" : "Doe-249",
        "full_name" : "John-267 Doe-249",
        "company_name" : "Company-273",
        "email" : "customer-264@example.com",
        "phone_number" : "+15555550276",
        "phone_numbers" : {
          "+15555550276" : {
            "type" : "Mobile",
            "number" : "+15555550276",
            "primary" : true
          }
        },
        "notes" : "Notes-273",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:01+0000",
        "updated_at" : "2016-02-09T16:08:01+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:08:01+0000",
          "updated_at" : "2016-02-09T16:08:01+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Group jobs by customer

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "customer_id_in" : [
      "316",
      "317"
    ],
    "by_job_customer" : "true"
  },
  "sort" : "created_at DESC"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2674

BODY
{
  "jobs" : [
    {
      "id" : 247,
      "organization_id" : 382,
      "title" : "Job Title 241",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 259",
      "created_at" : "2016-02-08T16:08:07+0000",
      "updated_at" : "2016-02-09T16:08:07+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 316,
      "brand_id" : null,
      "source" : null,
      "uid" : "754b280b-dc25-46a5-8808-6e0c31364d25",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1318,
        "addressable_id" : 247,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 316,
        "organization_id" : 382,
        "first_name" : "John-305",
        "last_name" : "Doe-287",
        "full_name" : "John-305 Doe-287",
        "company_name" : "Company-320",
        "email" : "customer-311@example.com",
        "phone_number" : "+15555550314",
        "phone_numbers" : {
          "+15555550314" : {
            "type" : "Mobile",
            "number" : "+15555550314",
            "primary" : true
          }
        },
        "notes" : "Notes-320",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "home_address" : null,
        "billing_address" : null,
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 249,
      "organization_id" : 382,
      "title" : "Job Title 243",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 261",
      "created_at" : "2016-02-06T16:08:07+0000",
      "updated_at" : "2016-02-09T16:08:07+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 317,
      "brand_id" : null,
      "source" : null,
      "uid" : "155f7e09-cadd-4e91-b670-3e2da600152a",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1320,
        "addressable_id" : 249,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 317,
        "organization_id" : 382,
        "first_name" : "John-306",
        "last_name" : "Doe-288",
        "full_name" : "John-306 Doe-288",
        "company_name" : "Company-321",
        "email" : "customer-312@example.com",
        "phone_number" : "+15555550315",
        "phone_numbers" : {
          "+15555550315" : {
            "type" : "Mobile",
            "number" : "+15555550315",
            "primary" : true
          }
        },
        "notes" : "Notes-321",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:08:07+0000",
        "updated_at" : "2016-02-09T16:08:07+0000",
        "home_address" : null,
        "billing_address" : null,
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Group jobs by source and count them

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_group" : {
      "column" : "source",
      "aggregate" : "count"
    }
  },
  "sort" : "source ASC"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

127

BODY
[
  {
    "id" : null,
    "source" : "account3",
    "count" : 1
  },
  {
    "id" : null,
    "source" : "account2",
    "count" : 1
  },
  {
    "id" : null,
    "source" : "account1",
    "count" : 2
  }
]

List jobs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4030

BODY
{
  "jobs" : [
    {
      "id" : 159,
      "organization_id" : 350,
      "title" : "Job Title 171",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 171",
      "created_at" : "2016-02-09T16:07:56+0000",
      "updated_at" : "2016-02-09T16:07:56+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 233,
      "brand_id" : null,
      "source" : null,
      "uid" : "9ede1b1a-b63b-4bf7-b70f-43584d9447ad",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1063,
        "addressable_id" : 159,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:56+0000",
        "updated_at" : "2016-02-09T16:07:56+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 233,
        "organization_id" : 350,
        "first_name" : "John-231",
        "last_name" : "Doe-213",
        "full_name" : "John-231 Doe-213",
        "company_name" : "Company-237",
        "email" : "customer-228@example.com",
        "phone_number" : "+15555550240",
        "phone_numbers" : {
          "+15555550240" : {
            "type" : "Mobile",
            "number" : "+15555550240",
            "primary" : true
          }
        },
        "notes" : "Notes-237",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:56+0000",
        "updated_at" : "2016-02-09T16:07:56+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:56+0000",
          "updated_at" : "2016-02-09T16:07:56+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:56+0000",
          "updated_at" : "2016-02-09T16:07:56+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 158,
      "organization_id" : 350,
      "title" : "Job Title 170",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 170",
      "created_at" : "2016-02-09T16:07:56+0000",
      "updated_at" : "2016-02-09T16:07:56+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 232,
      "brand_id" : null,
      "source" : null,
      "uid" : "4919931c-8bff-4503-a000-c7f9ea701397",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1060,
        "addressable_id" : 158,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:56+0000",
        "updated_at" : "2016-02-09T16:07:56+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 232,
        "organization_id" : 350,
        "first_name" : "John-230",
        "last_name" : "Doe-212",
        "full_name" : "John-230 Doe-212",
        "company_name" : "Company-236",
        "email" : "customer-227@example.com",
        "phone_number" : "+15555550239",
        "phone_numbers" : {
          "+15555550239" : {
            "type" : "Mobile",
            "number" : "+15555550239",
            "primary" : true
          }
        },
        "notes" : "Notes-236",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:56+0000",
        "updated_at" : "2016-02-09T16:07:56+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:56+0000",
          "updated_at" : "2016-02-09T16:07:56+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:56+0000",
          "updated_at" : "2016-02-09T16:07:56+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Paginated jobs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "offset" : "1",
  "limit" : "2",
  "sort" : "created_at asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4030

BODY
{
  "jobs" : [
    {
      "id" : 168,
      "organization_id" : 356,
      "title" : "Job Title 180",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 180",
      "created_at" : "2016-02-09T12:07:58+0000",
      "updated_at" : "2016-02-09T16:07:58+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 242,
      "brand_id" : null,
      "source" : null,
      "uid" : "0c67f312-b6fb-4bde-b3fc-23b51e8dda70",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1090,
        "addressable_id" : 168,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 242,
        "organization_id" : 356,
        "first_name" : "John-240",
        "last_name" : "Doe-222",
        "full_name" : "John-240 Doe-222",
        "company_name" : "Company-246",
        "email" : "customer-237@example.com",
        "phone_number" : "+15555550249",
        "phone_numbers" : {
          "+15555550249" : {
            "type" : "Mobile",
            "number" : "+15555550249",
            "primary" : true
          }
        },
        "notes" : "Notes-246",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 169,
      "organization_id" : 356,
      "title" : "Job Title 181",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 181",
      "created_at" : "2016-02-09T13:07:58+0000",
      "updated_at" : "2016-02-09T16:07:58+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 243,
      "brand_id" : null,
      "source" : null,
      "uid" : "d476aa74-ed96-49a9-83ad-55fee2a9ba94",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1093,
        "addressable_id" : 169,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 243,
        "organization_id" : 356,
        "first_name" : "John-241",
        "last_name" : "Doe-223",
        "full_name" : "John-241 Doe-223",
        "company_name" : "Company-247",
        "email" : "customer-238@example.com",
        "phone_number" : "+15555550250",
        "phone_numbers" : {
          "+15555550250" : {
            "type" : "Mobile",
            "number" : "+15555550250",
            "primary" : true
          }
        },
        "notes" : "Notes-247",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:58+0000",
        "updated_at" : "2016-02-09T16:07:58+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:58+0000",
          "updated_at" : "2016-02-09T16:07:58+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Sorted jobs

returns List of Jobs by given set of filters

Parameters

Parameter Required Type Description
sort optional String Reorder results by given column and sorting direction.
Default sorting is ID descending, available values are "id desc", "id asc" and any other Job column name
limit optional Integer Return only given number of Jobs.
Used along with "offset" param
offset optional Integer Return only filtered Jobs starting from given offset.
Used along with "limit" param
filter[id_eq] optional Integer Return Job with given ID
filter[id_in] optional Array of Integer Return Jobs with given IDs
filter[title_cont] optional String Return Jobs with title containing specified string
filter[source_cont] optional String Return Jobs with source containing specified string
filter[status_eq] optional String Return Jobs which status matches
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[status_in] optional Array of String Return Jobs which status matches any of given
allowed statuses: "draft", "unscheduled", "scheduled", "in_progress", "complete", "closed"
filter[service_type_eq] optional String Return Jobs which service type
matches (based on Organization's service types)
filter[service_type_in] optional Array of String Return Jobs which service type matches any of given
(based on Organization's service types)
filter[address_address_cache_cont] optional String Return Jobs with address containing specified string
filter[organization_id_eq] optional Integer Return Jobs with given Organization ID
filter[users_id_in] optional Array of Integer Return Jobs which are performed by given User ID (technician)
filter[users_full_name_cont] optional String Return Jobs which are performed by User name containing
specified string
filter[customer_id_eq] optional Integer Return Jobs of given Customer ID
filter[customer_full_name_cont] optional String Return Jobs of Customer's name containing specified string
filter[customer_phone_number_cont] optional String Return Jobs of Customer's phone number containing
specified string
filter[by_job_customer] optional Boolean Return Jobs grouped by Customer ID.
This effectively returns latest job of all filtered Customers

Request

ROUTE
GET /v1/jobs
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "id asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4030

BODY
{
  "jobs" : [
    {
      "id" : 161,
      "organization_id" : 352,
      "title" : "Job Title 173",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 173",
      "created_at" : "2016-02-09T16:07:57+0000",
      "updated_at" : "2016-02-09T16:07:57+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 235,
      "brand_id" : null,
      "source" : null,
      "uid" : "bdf03fa0-2927-49da-8f3e-1a0c23083b22",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1069,
        "addressable_id" : 161,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:57+0000",
        "updated_at" : "2016-02-09T16:07:57+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 235,
        "organization_id" : 352,
        "first_name" : "John-233",
        "last_name" : "Doe-215",
        "full_name" : "John-233 Doe-215",
        "company_name" : "Company-239",
        "email" : "customer-230@example.com",
        "phone_number" : "+15555550242",
        "phone_numbers" : {
          "+15555550242" : {
            "type" : "Mobile",
            "number" : "+15555550242",
            "primary" : true
          }
        },
        "notes" : "Notes-239",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:57+0000",
        "updated_at" : "2016-02-09T16:07:57+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:57+0000",
          "updated_at" : "2016-02-09T16:07:57+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:57+0000",
          "updated_at" : "2016-02-09T16:07:57+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    },
    {
      "id" : 162,
      "organization_id" : 352,
      "title" : "Job Title 174",
      "status" : "unscheduled",
      "status_message" : null,
      "resume_at" : null,
      "description" : "Job Description 174",
      "created_at" : "2016-02-09T16:07:57+0000",
      "updated_at" : "2016-02-09T16:07:57+0000",
      "service_type" : "plumber",
      "custom_fields" : {},
      "customer_id" : 236,
      "brand_id" : null,
      "source" : null,
      "uid" : "62546cff-c0af-48b3-9754-57cb294e5c80",
      "source_id" : null,
      "labels" : [],
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1072,
        "addressable_id" : 162,
        "addressable_type" : "Job",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:07:57+0000",
        "updated_at" : "2016-02-09T16:07:57+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "customer" : {
        "id" : 236,
        "organization_id" : 352,
        "first_name" : "John-234",
        "last_name" : "Doe-216",
        "full_name" : "John-234 Doe-216",
        "company_name" : "Company-240",
        "email" : "customer-231@example.com",
        "phone_number" : "+15555550243",
        "phone_numbers" : {
          "+15555550243" : {
            "type" : "Mobile",
            "number" : "+15555550243",
            "primary" : true
          }
        },
        "notes" : "Notes-240",
        "custom_fields" : {},
        "created_at" : "2016-02-09T16:07:57+0000",
        "updated_at" : "2016-02-09T16:07:57+0000",
        "home_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:57+0000",
          "updated_at" : "2016-02-09T16:07:57+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "billing_address" : {
          "id" : null,
          "addressable_id" : null,
          "addressable_type" : null,
          "street_1" : "123 Summer St",
          "street_2" : "apt 5",
          "postal_code" : "02110",
          "city" : "Boston",
          "state" : "MA",
          "country" : "United States",
          "latitude" : 40.7143528,
          "longitude" : -74.0059731,
          "created_at" : "2016-02-09T16:07:57+0000",
          "updated_at" : "2016-02-09T16:07:57+0000",
          "version" : "v1",
          "updated_by" : "system"
        },
        "version" : "v1",
        "updated_by" : "system",
        "external_ids" : []
      }
    }
  ]
}

Update job

Updates a Job for a given set of parameters

Parameters

Parameter Required Type Description
title optional String Short description of a job
description optional Text Long description of a job
service_type optional String Service type key from Organization. Must match existing key.
status optional String One of 'draft', 'unscheduled', 'complete', 'canceled', 'closed'.
There are some auto-calculated statuses: 'scheduled', 'in_progress' and 'complete'.
'draft' — means it is draft and that job is no accepted yet.
'accepted' — means it is accepted by service provider.
'rejected' — means it is rejected by service provider.
'unscheduled' - is default status, means that job has no appointments. Job is accepted.
'scheduled' - means that job has at least one 'scheduled' appointment.
'in_progress' - means that at least one appointment is currently in progress (enroute, onsite, started, paused).
'complete' - means that all appointments are complete. (no new scheduled work).
'canceled' - means that job is canceled.
'closed' - means that case is closed. Everything is paid, Job is complete and no further job supposed to be done.
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity
brand_id optional Integer Custom Brand settings for this Job
status_message optional String Message explaining the change of job status, if necessary
Message may be retrieved in related 'job.status' event

Request

ROUTE
PATCH /v1/jobs/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "256"
}
BODY
{
  "title" : "New Title",
  "description" : "New Description",
  "service_type" : "electrician",
  "tag_list" : "pie|cookie, cake",
  "custom_fields" : {
    "key42" : "new_value"
  },
  "brand_id" : 11,
  "source" : "new friend",
  "status" : "draft",
  "status_message" : "new status message",
  "resume_at" : "2014-12-30",
  "labels" : [
    {
      "label_id" : 30
    },
    {
      "label_id" : 31
    },
    {
      "label_id" : 29
    },
    {
      "date" : "2016-01-11T12:39:13+00:00",
      "color" : "#000000",
      "title" : "My cool label"
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2332

BODY
{
  "job" : {
    "id" : 256,
    "organization_id" : 384,
    "title" : "New Title",
    "status" : "draft",
    "status_message" : "new status message",
    "resume_at" : "2014-12-30T00:00:00+0000",
    "description" : "New Description",
    "created_at" : "2016-02-09T16:08:08+0000",
    "updated_at" : "2016-02-09T16:08:08+0000",
    "service_type" : "electrician",
    "custom_fields" : {
      "key42" : "new_value"
    },
    "customer_id" : 323,
    "brand_id" : 11,
    "source" : "friend",
    "uid" : "29d2ac78-6280-4c46-adb1-0e05c7b29e4e",
    "source_id" : null,
    "labels" : [
      {
        "label_id" : 29,
        "date" : null,
        "color" : "#AA0000",
        "title" : "Label 24"
      },
      {
        "label_id" : 30,
        "date" : null,
        "color" : null,
        "title" : "Label 25"
      },
      {
        "label_id" : 32,
        "date" : "2016-01-11T12:39:13+0000",
        "color" : "#000000",
        "title" : "My cool label"
      }
    ],
    "version" : "v1",
    "updated_by" : "user:f89b1251-9fdb-4c3c-add7-2dda9c026379",
    "external_ids" : [
      "account1:1001"
    ],
    "address" : {
      "id" : 1336,
      "addressable_id" : 256,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:08+0000",
      "updated_at" : "2016-02-09T16:08:08+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    "customer" : {
      "id" : 323,
      "organization_id" : 384,
      "first_name" : "John-312",
      "last_name" : "Doe-294",
      "full_name" : "John-312 Doe-294",
      "company_name" : "Company-327",
      "email" : "customer-318@example.com",
      "phone_number" : "+15555550321",
      "phone_numbers" : {
        "+15555550321" : {
          "type" : "Mobile",
          "number" : "+15555550321",
          "primary" : true
        }
      },
      "notes" : "Notes-327",
      "custom_fields" : {},
      "created_at" : "2016-02-09T16:08:08+0000",
      "updated_at" : "2016-02-09T16:08:08+0000",
      "home_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:08+0000",
        "updated_at" : "2016-02-09T16:08:08+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "billing_address" : {
        "id" : null,
        "addressable_id" : null,
        "addressable_type" : null,
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:08+0000",
        "updated_at" : "2016-02-09T16:08:08+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : []
    }
  }
}

Public information of job

Returns the details of the specified public job

Request

ROUTE
GET /v1/public/jobs/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "18be9032-af04-4c9e-996c-6e85f766dbbf"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

532

BODY
{
  "job" : {
    "uid" : "18be9032-af04-4c9e-996c-6e85f766dbbf",
    "title" : "Job Title 317",
    "status" : "unscheduled",
    "description" : "Job Description 335",
    "service_type" : "plumber",
    "brand_id" : null,
    "address" : {
      "id" : 1756,
      "addressable_id" : 332,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:39+0000",
      "updated_at" : "2016-02-09T16:08:39+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  }
}

Public feedback info on job

Returns the Survey Response, Job details, User details and Organization details for a given Survey Response ID

Request

ROUTE
GET /v1/public/survey_responses/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "dfe91832-9c7c-484a-8c06-c22645a32927"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1645

BODY
{
  "survey_response" : {
    "uid" : "dfe91832-9c7c-484a-8c06-c22645a32927",
    "rating" : 0,
    "message" : "cool",
    "is_responded" : false,
    "created_at" : "2016-02-09T16:08:39+0000",
    "brand_name" : null,
    "brand_logo_token" : null,
    "brand_tracker_logo_token" : null
  },
  "job" : {
    "uid" : "b0a706ec-c782-4b79-a9ea-3389bd4dab5d",
    "title" : "Job Title 318",
    "status" : "unscheduled",
    "description" : "Job Description 336",
    "service_type" : "plumber",
    "brand_id" : null,
    "address" : {
      "id" : 1762,
      "addressable_id" : 333,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:39+0000",
      "updated_at" : "2016-02-09T16:08:39+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  },
  "user" : {
    "uid" : "6a009405-3a44-4035-aa4b-6b6b0fcb1f7d",
    "first_name" : "Bob 500",
    "last_name" : "Smith 500",
    "full_name" : "Bob 500 Smith 500",
    "occupation" : "electrician",
    "photo_token" : "e0f320b7-c441-458d-a261-66262325bfac"
  },
  "organization" : {
    "uid" : "c24ead44-5c5f-40ab-887f-68f4fc256fe8",
    "name" : "Dispatch#-573",
    "email" : "dispatch-578@example.com",
    "twilio_phone_number" : null,
    "logo_token" : "09b86a0b-8d24-4133-92ef-9d7dab2cdb47",
    "tracker_logo_token" : "89afa088-3013-4505-90fb-784ba66fb816",
    "url" : "https://test-580.dispatch.me",
    "about" : null,
    "address" : {
      "id" : 1761,
      "addressable_id" : 586,
      "addressable_type" : "Organization",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:39+0000",
      "updated_at" : "2016-02-09T16:08:39+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  }
}

Public update feedback info on job

Creates or updates a survey response for a given set of parameters.

Parameters

Parameter Required Type Description
rating required Integer Star rating value expressed as an integer
message optional String Message to include with the survey response
is_responded optional Boolean Locks the answer from being updated again when set to true

Request

ROUTE
PATCH /v1/public/survey_responses/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "121df86f-b5cf-4af0-bce2-114ac284edc0"
}
BODY
{
  "rating" : 5,
  "message" : "test",
  "is_responded" : true
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

228

BODY
{
  "survey_response" : {
    "uid" : "121df86f-b5cf-4af0-bce2-114ac284edc0",
    "rating" : 5,
    "message" : "test",
    "is_responded" : true,
    "created_at" : "2016-02-09T16:08:39+0000",
    "brand_name" : null,
    "brand_logo_token" : null,
    "brand_tracker_logo_token" : null
  }
}

Tracking branded job

Returns the Organization, Job and Users for a specified job, for which the appointment must be in progress

Request

ROUTE
GET /v1/public/tracker/:uid
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "uid" : "f78f4cde-28f8-454f-b7de-2ed340d83e10"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1113

BODY
{
  "organization" : {
    "id" : 590,
    "name" : "Dispatch#-577",
    "phone_number" : "+15555550582",
    "email" : "dispatch-582@example.com",
    "about" : null,
    "logo_token" : "0875ab58-872e-4927-b7e0-9ce404b6404d",
    "tracker_logo_token" : "3abf0a74-b17f-45f0-bc1b-faab9e056052",
    "url" : "https://test-584.dispatch.me"
  },
  "job" : {
    "title" : "Job Title 322",
    "address" : {
      "id" : 1782,
      "addressable_id" : 337,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:40+0000",
      "updated_at" : "2016-02-09T16:08:40+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    "service_type" : "Plumbing"
  },
  "users" : [
    {
      "id" : 513,
      "full_name" : "Bob 504 Smith 504",
      "occupation" : "electrician",
      "photo_token" : "04d9fa1b-d96f-43e2-a447-1182c9c0d032",
      "phone_number" : "+15555550510",
      "latitude" : null,
      "longitude" : null,
      "location_updated_at" : null
    }
  ],
  "brand" : {
    "name" : "Brand-10",
    "phone_number" : "+15555550010",
    "email" : "brand-10@example.com",
    "logo_token" : "fabe58f4-f72f-4b81-bc1e-de0a900155eb",
    "tracker_logo_token" : "fca9843a-d812-4d98-9803-a947dea91f49"
  }
}

Tracking information

Returns the Organization, Job and Users for a specified job, for which the appointment must be in progress

Request

ROUTE
GET /v1/public/tracker/:uid
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "uid" : "5d1b13f3-86d4-450c-85dd-a657e02636dd"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

912

BODY
{
  "organization" : {
    "id" : 589,
    "name" : "Dispatch#-576",
    "phone_number" : "+15555550581",
    "email" : "dispatch-581@example.com",
    "about" : null,
    "logo_token" : "3246fef7-fd49-44e3-a3dc-f0923599b044",
    "tracker_logo_token" : "77b04f39-b45e-4714-941d-d9b69cfe881b",
    "url" : "https://test-583.dispatch.me"
  },
  "job" : {
    "title" : "Job Title 321",
    "address" : {
      "id" : 1777,
      "addressable_id" : 336,
      "addressable_type" : "Job",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:40+0000",
      "updated_at" : "2016-02-09T16:08:40+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    "service_type" : "Plumbing"
  },
  "users" : [
    {
      "id" : 512,
      "full_name" : "Bob 503 Smith 503",
      "occupation" : "electrician",
      "photo_token" : "06727403-92da-473e-817f-de8c80d7f33b",
      "phone_number" : "+15555550509",
      "latitude" : null,
      "longitude" : null,
      "location_updated_at" : null
    }
  ]
}

List job sources

Request

ROUTE
GET /v1/sources
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

133

BODY
{
  "sources" : [
    {
      "id" : 152,
      "name" : "account_61",
      "title" : "Account 152",
      "phone_number" : "+15555550152",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

List sources

Request

ROUTE
GET /v1/sources
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

253

BODY
{
  "sources" : [
    {
      "id" : 156,
      "name" : "account_65",
      "title" : "Account 156",
      "phone_number" : "+15555550156",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 157,
      "name" : "account_66",
      "title" : "Account 157",
      "phone_number" : "+15555550157",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

List sources

Request

ROUTE
GET /v1/sources
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

253

BODY
{
  "sources" : [
    {
      "id" : 153,
      "name" : "account_62",
      "title" : "Account 153",
      "phone_number" : "+15555550153",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 154,
      "name" : "account_63",
      "title" : "Account 154",
      "phone_number" : "+15555550154",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Feedback on job

Returns list of survey responses

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/survey_responses
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "appointment_id_in" : [
      "151",
      "152",
      "153"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1183

BODY
{
  "survey_responses" : [
    {
      "id" : 9,
      "uid" : "7fc7f82f-9f06-437b-89b6-b87a05f2a80e",
      "appointment_id" : 153,
      "rating" : 0,
      "message" : null,
      "is_responded" : false,
      "created_at" : "2016-02-09T16:08:46+0000",
      "updated_at" : "2016-02-09T16:08:46+0000",
      "brand_name" : "Brand-11",
      "brand_logo_token" : "660750a0-a589-4b04-a86d-b612e1781622",
      "brand_tracker_logo_token" : "0902b2b8-966b-49b1-9b17-deb45299ae9d",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 8,
      "uid" : "8077e382-093f-4784-8fbd-64b8d5ac12f9",
      "appointment_id" : 152,
      "rating" : 0,
      "message" : null,
      "is_responded" : false,
      "created_at" : "2016-02-09T16:08:46+0000",
      "updated_at" : "2016-02-09T16:08:46+0000",
      "brand_name" : "Brand-11",
      "brand_logo_token" : "660750a0-a589-4b04-a86d-b612e1781622",
      "brand_tracker_logo_token" : "0902b2b8-966b-49b1-9b17-deb45299ae9d",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 7,
      "uid" : "d6f80ae7-826a-4ac5-ba14-409075fe010d",
      "appointment_id" : 151,
      "rating" : 0,
      "message" : null,
      "is_responded" : false,
      "created_at" : "2016-02-09T16:08:46+0000",
      "updated_at" : "2016-02-09T16:08:46+0000",
      "brand_name" : "Brand-11",
      "brand_logo_token" : "660750a0-a589-4b04-a86d-b612e1781622",
      "brand_tracker_logo_token" : "0902b2b8-966b-49b1-9b17-deb45299ae9d",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Organization

Create organization

Creates an Organization for a given set of parameters.

Parameters

Parameter Required Type Description
name required String Organization's Name, will be publicly available
email required String Organization's Email
email_from optional String Where emails would be sent "from"
url optional String Organization's Website URL, will be publicly available
phone_number required String Organization's phone number, will be publicly available
about optional Text Description of organization, will be publicly available
accepted_payment_options optional Array of String Payment Options: cash check
line_item_level_tax optional Boolean Determine line_item tax level
logo_token optional UUID Logo image token (UUID)
tracker_logo_token optional UUID Logo token (UUID) for Webtracker app
is_allowed_notifications optional Boolean Turn on to allow sending notifications
currency optional String Organization's default currency in ISO format.
See full list of available Currencies at https://goo.gl/KZ8ftm
working_hours optional Hash Global Availability hours for organization,
will be inherited by its users.
The key means day of the week starting from 0 - Sunday
Value contains availability hours for the day of the week "08:00AM - 06:00PM"
service_types required Hash Services that are available for organization's Users and Jobs
Keys used in User service_types and Jobs service_type fields
Values are used to display in Control panel and app
Example: { 'handyman' => 'Handyman' }
max_job_drive_time optional Integer when enabled, availability queries will calculate drive
distance from existing jobs and permit new job in a given drive time value
Allowed values: 0 when disabled, 5, 10, 15, 30, 60

Request

ROUTE
POST /v1/organizations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "name" : "Test Name",
  "email" : "some@example.com",
  "url" : "http://example.com",
  "phone_number" : "(555)555-4444",
  "service_types" : {
    "plumber" : "Plumber"
  },
  "line_item_level_tax" : true,
  "max_job_drive_time" : 30,
  "external_ids" : [
    "very_special_name:10001",
    "very_special_name:10002"
  ],
  "country" : "United States",
  "address" : {
    "street_1" : "170 Milk Street",
    "city" : "Boston",
    "state" : "MA",
    "postal_code" : "02109",
    "country" : "United States"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1466

BODY
{
  "organization" : {
    "id" : 473,
    "created_at" : "2016-02-09T16:08:20+0000",
    "updated_at" : "2016-02-09T16:08:20+0000",
    "name" : "Test Name",
    "email" : "some@example.com",
    "email_from" : null,
    "phone_number" : "+15555554444",
    "twilio_phone_number" : null,
    "line_item_level_tax" : true,
    "logo_token" : null,
    "tracker_logo_token" : null,
    "url" : "http://example.com",
    "about" : null,
    "accepted_payment_options" : [
      "cash",
      "check"
    ],
    "is_configured" : true,
    "working_hours" : {
      "0" : [],
      "1" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "2" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "3" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "4" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "5" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "6" : []
    },
    "service_types" : {
      "plumber" : "Plumber"
    },
    "is_allowed_notifications" : true,
    "is_available_for_job_offers" : true,
    "timezone" : null,
    "country" : "United States",
    "currency" : "USD",
    "signup_source" : "very_special_name",
    "reporting_enabled" : true,
    "max_job_drive_time" : 30,
    "version" : "v1",
    "updated_by" : "account:4cc9a9c2-1194-4610-8fc3-037a2247b841",
    "external_ids" : [
      "very_special_name:10001",
      "very_special_name:10002"
    ],
    "address" : {
      "id" : 1512,
      "addressable_id" : 473,
      "addressable_type" : "Organization",
      "street_1" : "170 Milk Street",
      "street_2" : null,
      "postal_code" : "02109",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : null,
      "longitude" : null,
      "created_at" : "2016-02-09T16:08:20+0000",
      "updated_at" : "2016-02-09T16:08:20+0000",
      "version" : "v1",
      "updated_by" : "account:4cc9a9c2-1194-4610-8fc3-037a2247b841"
    }
  }
}

Create organization

Creates an Organization for a given set of parameters.

Parameters

Parameter Required Type Description
name required String Organization's Name, will be publicly available
email required String Organization's Email
email_from optional String Where emails would be sent "from"
url optional String Organization's Website URL, will be publicly available
phone_number required String Organization's phone number, will be publicly available
about optional Text Description of organization, will be publicly available
accepted_payment_options optional Array of String Payment Options: cash check
line_item_level_tax optional Boolean Determine line_item tax level
logo_token optional UUID Logo image token (UUID)
tracker_logo_token optional UUID Logo token (UUID) for Webtracker app
is_allowed_notifications optional Boolean Turn on to allow sending notifications
currency optional String Organization's default currency in ISO format.
See full list of available Currencies at https://goo.gl/KZ8ftm
working_hours optional Hash Global Availability hours for organization,
will be inherited by its users.
The key means day of the week starting from 0 - Sunday
Value contains availability hours for the day of the week "08:00AM - 06:00PM"
service_types required Hash Services that are available for organization's Users and Jobs
Keys used in User service_types and Jobs service_type fields
Values are used to display in Control panel and app
Example: { 'handyman' => 'Handyman' }
max_job_drive_time optional Integer when enabled, availability queries will calculate drive
distance from existing jobs and permit new job in a given drive time value
Allowed values: 0 when disabled, 5, 10, 15, 30, 60

Request

ROUTE
POST /v1/organizations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "name" : "Test Name",
  "email" : "some@example.com",
  "url" : "http://example.com",
  "phone_number" : "(555)555-4444",
  "service_types" : {
    "plumber" : "Plumber"
  },
  "line_item_level_tax" : true,
  "max_job_drive_time" : 30,
  "external_ids" : [
    "very_special_name:10001",
    "very_special_name:10002"
  ],
  "country" : "United States",
  "address" : {
    "street_1" : "170 Milk Street",
    "city" : "Boston",
    "state" : "MA",
    "postal_code" : "02109",
    "country" : "United States"
  },
  "timezone" : "Central Time (US & Canada)"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1490

BODY
{
  "organization" : {
    "id" : 474,
    "created_at" : "2016-02-09T16:08:20+0000",
    "updated_at" : "2016-02-09T16:08:21+0000",
    "name" : "Test Name",
    "email" : "some@example.com",
    "email_from" : null,
    "phone_number" : "+15555554444",
    "twilio_phone_number" : null,
    "line_item_level_tax" : true,
    "logo_token" : null,
    "tracker_logo_token" : null,
    "url" : "http://example.com",
    "about" : null,
    "accepted_payment_options" : [
      "cash",
      "check"
    ],
    "is_configured" : true,
    "working_hours" : {
      "0" : [],
      "1" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "2" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "3" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "4" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "5" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "6" : []
    },
    "service_types" : {
      "plumber" : "Plumber"
    },
    "is_allowed_notifications" : true,
    "is_available_for_job_offers" : true,
    "timezone" : "Central Time (US & Canada)",
    "country" : "United States",
    "currency" : "USD",
    "signup_source" : "very_special_name",
    "reporting_enabled" : true,
    "max_job_drive_time" : 30,
    "version" : "v1",
    "updated_by" : "account:b8836369-1930-4ca7-8ed8-a9dddb12e927",
    "external_ids" : [
      "very_special_name:10001",
      "very_special_name:10002"
    ],
    "address" : {
      "id" : 1513,
      "addressable_id" : 474,
      "addressable_type" : "Organization",
      "street_1" : "170 Milk Street",
      "street_2" : null,
      "postal_code" : "02109",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : null,
      "longitude" : null,
      "created_at" : "2016-02-09T16:08:21+0000",
      "updated_at" : "2016-02-09T16:08:21+0000",
      "version" : "v1",
      "updated_by" : "account:b8836369-1930-4ca7-8ed8-a9dddb12e927"
    }
  }
}

Create organization as User

Creates an Organization for a given set of parameters.

Parameters

Parameter Required Type Description
name required String Organization's Name, will be publicly available
email required String Organization's Email
email_from optional String Where emails would be sent "from"
url optional String Organization's Website URL, will be publicly available
phone_number required String Organization's phone number, will be publicly available
about optional Text Description of organization, will be publicly available
accepted_payment_options optional Array of String Payment Options: cash check
line_item_level_tax optional Boolean Determine line_item tax level
logo_token optional UUID Logo image token (UUID)
tracker_logo_token optional UUID Logo token (UUID) for Webtracker app
is_allowed_notifications optional Boolean Turn on to allow sending notifications
currency optional String Organization's default currency in ISO format.
See full list of available Currencies at https://goo.gl/KZ8ftm
working_hours optional Hash Global Availability hours for organization,
will be inherited by its users.
The key means day of the week starting from 0 - Sunday
Value contains availability hours for the day of the week "08:00AM - 06:00PM"
service_types required Hash Services that are available for organization's Users and Jobs
Keys used in User service_types and Jobs service_type fields
Values are used to display in Control panel and app
Example: { 'handyman' => 'Handyman' }
max_job_drive_time optional Integer when enabled, availability queries will calculate drive
distance from existing jobs and permit new job in a given drive time value
Allowed values: 0 when disabled, 5, 10, 15, 30, 60

Request

ROUTE
POST /v1/organizations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "name" : "Test Name",
  "email" : "some@example.com",
  "url" : "http://example.com",
  "phone_number" : "(555)555-4444",
  "service_types" : {
    "plumber" : "Plumber"
  },
  "timezone" : "Eastern Time (US & Canada)",
  "max_job_drive_time" : 60,
  "external_ids" : [
    "qb:10001",
    "qb:10002"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1214

BODY
{
  "organization" : {
    "id" : 478,
    "created_at" : "2016-02-09T16:08:21+0000",
    "updated_at" : "2016-02-09T16:08:21+0000",
    "name" : "Test Name",
    "email" : "some@example.com",
    "email_from" : null,
    "phone_number" : "+15555554444",
    "twilio_phone_number" : null,
    "line_item_level_tax" : false,
    "logo_token" : null,
    "tracker_logo_token" : null,
    "url" : "http://example.com",
    "about" : null,
    "accepted_payment_options" : [
      "cash",
      "check"
    ],
    "is_configured" : true,
    "working_hours" : {
      "0" : [],
      "1" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "2" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "3" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "4" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "5" : [
        "08:00:00 - 11:59:59",
        "12:00:00 - 15:59:59"
      ],
      "6" : []
    },
    "service_types" : {
      "plumber" : "Plumber"
    },
    "is_allowed_notifications" : true,
    "is_available_for_job_offers" : true,
    "timezone" : "Eastern Time (US & Canada)",
    "country" : "United States",
    "currency" : "USD",
    "signup_source" : null,
    "twilio_enabled" : false,
    "twilio_fwd_sms" : false,
    "twilio_fwd_voice" : false,
    "twilio_fwd_sms_phone_number" : null,
    "twilio_fwd_voice_phone_number" : null,
    "reporting_enabled" : true,
    "max_job_drive_time" : 60,
    "version" : "v1",
    "updated_by" : "user:e57fca51-a732-4ae5-a257-72b68958649c",
    "external_ids" : [
      "qb:10001",
      "qb:10002"
    ],
    "address" : null
  }
}

List organizations

List of Organizations

Request

ROUTE
GET /v1/organizations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1483

BODY
{
  "organizations" : [
    {
      "id" : 479,
      "created_at" : "2016-02-09T16:08:21+0000",
      "updated_at" : "2016-02-09T16:08:21+0000",
      "name" : "Dispatch#-468",
      "email" : "dispatch-473@example.com",
      "email_from" : null,
      "phone_number" : "+15555550473",
      "twilio_phone_number" : null,
      "line_item_level_tax" : false,
      "logo_token" : "b3267615-272f-4df4-96e3-bc50dbe9a213",
      "tracker_logo_token" : "ffc3a9d7-237d-40c0-94e2-354464324f4b",
      "url" : "https://test-475.dispatch.me",
      "about" : null,
      "accepted_payment_options" : [
        "cash",
        "check"
      ],
      "is_configured" : true,
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "service_types" : {
        "plumber" : "Plumber",
        "electrician" : "Electrician"
      },
      "is_allowed_notifications" : true,
      "is_available_for_job_offers" : true,
      "timezone" : "Eastern Time (US & Canada)",
      "country" : "United States",
      "currency" : "USD",
      "signup_source" : null,
      "reporting_enabled" : true,
      "max_job_drive_time" : 0,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 1515,
        "addressable_id" : 479,
        "addressable_type" : "Organization",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:08:21+0000",
        "updated_at" : "2016-02-09T16:08:21+0000",
        "version" : "v1",
        "updated_by" : "system"
      }
    }
  ]
}

Update organization

Updates Organization params

Parameters

Parameter Required Type Description
name optional String Organization's Name, will be publicly available
email optional String Organization's Email
email_from optional String Where emails would be sent "from"
url optional String Organization's Website URL, will be publicly available
phone_number optional String Organization's phone number, will be publicly available
about optional Text Description of organization, will be publicly available
is_allowed_notifications optional Boolean Turn on to allow sending notifications
accepted_payment_options optional Array of String Payment Options: cash check
line_item_level_tax optional Boolean Determine line_item tax level
logo optional Hash Logo to be used for branding in webtracker and feedback forms,
on invoices etc.
logo[filename] optional String Logo file name
logo[filedata] optional String Logo base64 encoded image
currency optional String Organization's default currency in ISO format.
See full list of available Currencies at https://goo.gl/KZ8ftm
working_hours optional Hash Global Availability hours for organization,
will be inherited by its users.
The key means day of the week starting from 0 - Sunday
Value contains availability hours for the day of the week "08:00AM - 06:00PM"
service_types optional Hash Services that are available for organization's Users and Jobs
Keys used in User service_types and Jobs service_type fields
Values are used to display in Control panel and app
Example: { 'handyman' => 'Handyman' }
is_configured optional Boolean Shows that all the configuration done.
is_available_for_job_offers optional Boolean Indicates if organization accepts jobs
max_job_drive_time optional Integer when enabled, availability queries will calculate drive
distance from existing jobs and permit new job in a given drive time value
Allowed values: 0 when disabled, 5, 10, 15, 30, 60

Request

ROUTE
PATCH /v1/organizations/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "520"
}
BODY
{
  "name" : "new name",
  "email" : "new@example.com",
  "email_from" : "Mike",
  "accepted_payment_options" : [
    "card"
  ],
  "service_types" : {
    "plumber" : "Plumber"
  },
  "timezone" : "Eastern Time (US & Canada)",
  "is_configured" : true,
  "line_item_level_tax" : true,
  "phone_number" : "5556666666",
  "address" : {
    "street_1" : "123 Main Street",
    "street_2" : "#666",
    "country" : "Canada"
  },
  "logo_token" : "xxxxx",
  "tracker_logo_token" : "yyyyy",
  "working_hours" : {
    "0" : null,
    "1" : "2:00AM - 3:00PM",
    "2" : "3:00AM - 4:00PM",
    "3" : "4:00AM - 5:00PM",
    "4" : "5:00AM - 6:00PM",
    "5" : "6:00AM - 7:00PM",
    "6" : [
      "7:00 - 12:00",
      "12:00 - 14:00"
    ]
  },
  "country" : "Canada",
  "max_job_drive_time" : 30
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1332

BODY
{
  "organization" : {
    "id" : 520,
    "created_at" : "2016-02-09T16:08:26+0000",
    "updated_at" : "2016-02-09T16:08:26+0000",
    "name" : "new name",
    "email" : "new@example.com",
    "email_from" : "Mike",
    "phone_number" : "+15556666666",
    "twilio_phone_number" : null,
    "line_item_level_tax" : true,
    "logo_token" : "xxxxx",
    "tracker_logo_token" : "yyyyy",
    "url" : "https://test-516.dispatch.me",
    "about" : null,
    "accepted_payment_options" : [],
    "is_configured" : true,
    "working_hours" : {
      "0" : [],
      "1" : [
        "02:00:00 - 15:00:00"
      ],
      "2" : [
        "03:00:00 - 16:00:00"
      ],
      "3" : [
        "04:00:00 - 17:00:00"
      ],
      "4" : [
        "05:00:00 - 18:00:00"
      ],
      "5" : [
        "06:00:00 - 19:00:00"
      ],
      "6" : [
        "07:00:00 - 14:00:00"
      ]
    },
    "service_types" : {
      "plumber" : "Plumber"
    },
    "is_allowed_notifications" : true,
    "is_available_for_job_offers" : true,
    "timezone" : "Eastern Time (US & Canada)",
    "country" : "Canada",
    "currency" : "USD",
    "signup_source" : null,
    "reporting_enabled" : true,
    "max_job_drive_time" : 30,
    "version" : "v1",
    "updated_by" : "user:a2297e38-89d4-4903-9ce0-1feb342dac9f",
    "external_ids" : [],
    "address" : {
      "id" : 1580,
      "addressable_id" : 520,
      "addressable_type" : "Organization",
      "street_1" : "123 Main Street",
      "street_2" : "#666",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "Canada",
      "latitude" : 40.7143528,
      "longitude" : -74.0059731,
      "created_at" : "2016-02-09T16:08:26+0000",
      "updated_at" : "2016-02-09T16:08:26+0000",
      "version" : "v1",
      "updated_by" : "user:a2297e38-89d4-4903-9ce0-1feb342dac9f"
    }
  }
}

Custom Field

Create custom field

Request

ROUTE
POST /v1/organizations/:organization_id/custom_user_fields
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "type" : "user",
  "organization_id" : "193"
}
BODY
{
  "field_type" : "dropdown",
  "values" : [
    "one",
    "two",
    "three"
  ],
  "title" : "very custom field"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

364

BODY
{
  "custom_user_field" : {
    "id" : 3,
    "organization_id" : 193,
    "key" : "very_custom_field",
    "title" : "very custom field",
    "field_type" : "dropdown",
    "is_public" : false,
    "values" : [
      "one",
      "two",
      "three"
    ],
    "position" : null,
    "created_at" : "2016-02-09T16:07:33+0000",
    "required" : false,
    "updated_at" : "2016-02-09T16:07:33+0000",
    "version" : "v1",
    "updated_by" : "user:9686892e-bf5c-4e97-afa8-f90a93694174"
  }
}

List custom fields

Request

ROUTE
GET /v1/organizations/:organization_id/custom_user_fields
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "type" : "user",
  "organization_id" : "211"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1383

BODY
{
  "custom_user_fields" : [
    {
      "id" : 15,
      "organization_id" : 211,
      "key" : "key6",
      "title" : "Field Name6",
      "field_type" : "dropdown",
      "is_public" : false,
      "values" : [],
      "position" : null,
      "created_at" : "2016-02-09T16:07:35+0000",
      "required" : false,
      "updated_at" : "2016-02-09T16:07:35+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 16,
      "organization_id" : 211,
      "key" : "key7",
      "title" : "Field Name7",
      "field_type" : "dropdown",
      "is_public" : false,
      "values" : [],
      "position" : null,
      "created_at" : "2016-02-09T16:07:35+0000",
      "required" : false,
      "updated_at" : "2016-02-09T16:07:35+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 17,
      "organization_id" : 211,
      "key" : "key8",
      "title" : "Field Name8",
      "field_type" : "short_text",
      "is_public" : false,
      "values" : [],
      "position" : null,
      "created_at" : "2016-02-09T16:07:35+0000",
      "required" : false,
      "updated_at" : "2016-02-09T16:07:35+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 18,
      "organization_id" : 211,
      "key" : "key9",
      "title" : "Field Name9",
      "field_type" : "checkbox",
      "is_public" : false,
      "values" : [],
      "position" : null,
      "created_at" : "2016-02-09T16:07:35+0000",
      "required" : false,
      "updated_at" : "2016-02-09T16:07:35+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 19,
      "organization_id" : 211,
      "key" : "key10",
      "title" : "Field Name10",
      "field_type" : "dropdown",
      "is_public" : false,
      "values" : [],
      "position" : null,
      "created_at" : "2016-02-09T16:07:35+0000",
      "required" : false,
      "updated_at" : "2016-02-09T16:07:35+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Delete custom field

Request

ROUTE
DELETE /v1/organizations/:organization_id/custom_user_fields/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "type" : "user",
  "organization_id" : "208",
  "id" : "12"
}
BODY
{}

Response

Update custom field

Request

ROUTE
PATCH /v1/organizations/:organization_id/custom_user_fields/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "type" : "user",
  "organization_id" : "223",
  "id" : "39"
}
BODY
{
  "title" : "New Name"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

327

BODY
{
  "custom_user_field" : {
    "id" : 39,
    "organization_id" : 223,
    "key" : "key30",
    "title" : "New Name",
    "field_type" : "short_text",
    "is_public" : false,
    "values" : [],
    "position" : null,
    "created_at" : "2016-02-09T16:07:37+0000",
    "required" : false,
    "updated_at" : "2016-02-09T16:07:37+0000",
    "version" : "v1",
    "updated_by" : "user:e70bbb81-7b78-42de-8e7d-f6260577f15a"
  }
}

User

Send password reset email

Sends instructions for resetting a password to the email address provided, as long as the account exists.

Parameters

Parameter Required Type Description
email required String Email address to send password reset email to (if account exists)

Request

ROUTE
POST /v1/password_resets
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "email" : "user-441@example.com"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

56

BODY
{
  "message" : "Instructions have been sent to your email."
}

Set new password

Resets the specified user password based on the temporary token included in the password reset email

Parameters

Parameter Required Type Description
password required String Password to update the account with

Request

ROUTE
PUT /v1/password_resets/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "1234567890"
}
BODY
{
  "password" : "new123456"
}

Response

Validate reset token

Request

ROUTE
GET /v1/password_resets/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "1234567890"
}

Response

Request verification code

Sends a Verification code via SMS message to the specified phone number

Request

ROUTE
POST /v1/phone_numbers/:phone_number_id/verification_codes
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "phone_number_id" : "+11231234567"
}
BODY
{}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

66

BODY
{
  "message" : "Verification code has been sent to the phone number."
}

Get token with verification code

Checks the specified Verification code to see if it matches the one sent via SMS message to the specified phone number

Request

ROUTE
GET /v1/phone_numbers/:phone_number_id/verification_codes/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "phone_number_id" : "+15555555555",
  "id" : "1234"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

207

BODY
{
  "access_token" : "5d28c3c1755eb952f8357a42878bca6d5cc74d97ffbe678ac93896bf02e5845d",
  "refresh_token" : "bda57a8259d789bd88f242f0fea97dc7451724221487a63f900c1b0f584b8633",
  "expires_in" : 10800,
  "token_type" : "bearer"
}

Update user location via public endpoint

Create a location record for a specified user by :uid

Parameters

Parameter Required Type Description
uid required String UUID of user
lat required Integer Latitude of the location
lng required Integer Longitude of the location
address optional String Address of the location

Request

ROUTE
POST /v1/public/locations/:uid
HEADERS
Content-Type

application/x-www-form-urlencoded

Accept

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

QUERY
{
  "lat" : "1.1",
  "lng" : "1.3",
  "address" : "Boston, MA",
  "uid" : "1c622dfc-dc43-4aec-b093-8f3d0f404752"
}
BODY

lat=1.1&lng=1.3&address=Boston%2C+MA

Response

HEADERS
Content-Type

text/plain; charset=utf-8

Content-Length

0

Create user

Creates a User for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
first_name required String First Name of the user
last_name required String Last Name of the user
full_name optional String when not set, full_name will be build by combining first and last name.
Otherwise it may be passed here
roles required Array of String Role of the user: "dispatcher" or "technician"
phone_number conditional String Required for technician only
Must be unique on dispatch.
mobile_verified optional Boolean when true, phone_number is confirmed to be mobile
mobile_verified_at optional Date time overwrite time when phone number was confirmed to be mobile
email conditional String Required for dispatcher only
Must be unique on dispatch.
password optional String Password to login in web interface
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity
service_types optional Array of String List of service types enabled for technician role
(must be subset of organization's service types)

Request

ROUTE
POST /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 692,
  "first_name" : "Fname",
  "last_name" : "Lname",
  "full_name" : "Mike Simpson",
  "roles" : [
    "dispatcher",
    "technician"
  ],
  "service_types" : [
    "plumber"
  ],
  "phone_number" : "(555) 555-5555",
  "email" : "new_technician@example.com",
  "occupation" : "plumber",
  "timezone" : "Pacific Time (US & Canada)",
  "address" : {
    "street_1" : "123 Summer St",
    "street_2" : "apt 5",
    "postal_code" : "02110",
    "city" : "Boston",
    "state" : "MA",
    "latitude" : 1.13,
    "longitude" : 3.17
  },
  "working_hours" : {
    "0" : null,
    "1" : [
      "08:00:00-10:00:00",
      "12:00:00-16:00:00",
      "17:00:00-20:00:00"
    ],
    "2" : [
      "08:00:00-12:00:00",
      "12:00:00-14:00:00",
      "16:00:00-20:00:00"
    ],
    "3" : [
      "08:00:00-12:00:00",
      "12:00:00-16:00:00",
      "16:00:00-20:00:00"
    ],
    "4" : [
      "08:00:00-12:00:00",
      "12:00:00-16:00:00",
      "16:00:00-20:00:00"
    ],
    "5" : [
      "08:00:00-12:00:00",
      "12:00:00-16:00:00"
    ],
    "6" : null
  },
  "custom_fields" : {
    "key47" : "new value"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1484

BODY
{
  "user" : {
    "id" : 651,
    "uid" : "68a8e47d-8f26-486d-993a-4848f9d961c9",
    "organization_id" : 692,
    "first_name" : "Fname",
    "last_name" : "Lname",
    "full_name" : "Mike Simpson",
    "photo_token" : null,
    "email" : "new_technician@example.com",
    "phone_number" : "+15555555555",
    "mobile_verified" : true,
    "mobile_verified_at" : "2016-02-09T16:09:00+0000",
    "occupation" : "plumber",
    "roles" : [
      "technician",
      "dispatcher"
    ],
    "service_types" : [
      "plumber"
    ],
    "created_at" : "2016-02-09T16:09:00+0000",
    "updated_at" : "2016-02-09T16:09:00+0000",
    "working_hours" : {
      "0" : [],
      "1" : [
        "08:00:00 - 10:00:00",
        "12:00:00 - 16:00:00",
        "17:00:00 - 20:00:00"
      ],
      "2" : [
        "08:00:00 - 14:00:00",
        "16:00:00 - 20:00:00"
      ],
      "3" : [
        "08:00:00 - 20:00:00"
      ],
      "4" : [
        "08:00:00 - 20:00:00"
      ],
      "5" : [
        "08:00:00 - 16:00:00"
      ],
      "6" : []
    },
    "latitude" : 1.13,
    "longitude" : 3.17,
    "address_resolved" : "Boston, MA 02110",
    "notes" : null,
    "custom_fields" : {
      "key47" : "new value"
    },
    "is_admin" : false,
    "last_sign_in_at" : null,
    "is_available_for_job_offers" : true,
    "deleted_at" : null,
    "timezone" : "Eastern Time (US & Canada)",
    "meta" : {},
    "is_configured" : false,
    "version" : "v1",
    "updated_by" : "user:6b54f922-02f9-4b1c-88b5-3ca028ea9739",
    "external_ids" : [],
    "address" : {
      "id" : 2188,
      "addressable_id" : 651,
      "addressable_type" : "User",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 1.13,
      "longitude" : 3.17,
      "created_at" : "2016-02-09T16:09:00+0000",
      "updated_at" : "2016-02-09T16:09:00+0000",
      "version" : "v1",
      "updated_by" : "user:6b54f922-02f9-4b1c-88b5-3ca028ea9739"
    },
    "profiles" : []
  }
}

Filter by custom fields: full match

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "custom_fields_as_text_cont" : "\"one\"=>\"two\""
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1481

BODY
{
  "users" : [
    {
      "id" : 682,
      "uid" : "ea2088b3-9c48-4df7-b22a-1328fb19a889",
      "organization_id" : 707,
      "first_name" : "Bob 663",
      "last_name" : "Smith 663",
      "full_name" : "Bob 663 Smith 663",
      "photo_token" : "aabc2f8d-d82a-4664-90bd-d28e43212cbe",
      "email" : "user-675@example.com",
      "phone_number" : "+15555550672",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:03+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:03+0000",
      "updated_at" : "2016-02-09T16:09:03+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {
        "one" : "two"
      },
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2216,
        "addressable_id" : 682,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:03+0000",
        "updated_at" : "2016-02-09T16:09:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    }
  ]
}

Filter by custom fields: partial match

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "custom_fields_as_text_cont" : "=>\"two\""
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2951

BODY
{
  "users" : [
    {
      "id" : 687,
      "uid" : "d4c94301-150d-4443-a39f-409c2a0e2df0",
      "organization_id" : 708,
      "first_name" : "Bob 668",
      "last_name" : "Smith 668",
      "full_name" : "Bob 668 Smith 668",
      "photo_token" : "20580c24-d4a5-4d60-ab94-79e24f486ef0",
      "email" : "user-680@example.com",
      "phone_number" : "+15555550677",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:03+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:03+0000",
      "updated_at" : "2016-02-09T16:09:03+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {
        "two" : "two"
      },
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2220,
        "addressable_id" : 687,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:03+0000",
        "updated_at" : "2016-02-09T16:09:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    },
    {
      "id" : 686,
      "uid" : "eed143b7-f6c8-4796-87aa-5697df9a872f",
      "organization_id" : 708,
      "first_name" : "Bob 667",
      "last_name" : "Smith 667",
      "full_name" : "Bob 667 Smith 667",
      "photo_token" : "a694849b-5e29-4b9d-b65a-1546bfb01b11",
      "email" : "user-679@example.com",
      "phone_number" : "+15555550676",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:03+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:03+0000",
      "updated_at" : "2016-02-09T16:09:03+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {
        "one" : "two"
      },
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2219,
        "addressable_id" : 686,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:03+0000",
        "updated_at" : "2016-02-09T16:09:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    }
  ]
}

Filter by location

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_user_radius" : {
      "lat" : "0.01",
      "lng" : "0.02",
      "radius" : "25"
    }
  },
  "sort" : "users.distance asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2956

BODY
{
  "users" : [
    {
      "id" : 702,
      "uid" : "94872ef9-d994-4692-a695-d3eaf48ccb82",
      "organization_id" : 712,
      "first_name" : "Bob 683",
      "last_name" : "Smith 683",
      "full_name" : "Bob 683 Smith 683",
      "photo_token" : "e8c59ccf-dd01-441b-9bd6-a6deeb9c19cb",
      "email" : "user-692@example.com",
      "phone_number" : "+15555550689",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:05+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:05+0000",
      "updated_at" : "2016-02-09T16:09:05+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : 0.1,
      "longitude" : 0.2,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {
        "distance" : 13.9
      },
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2231,
        "addressable_id" : 702,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:05+0000",
        "updated_at" : "2016-02-09T16:09:05+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    },
    {
      "id" : 703,
      "uid" : "893d9527-0b45-40bd-8892-dac8b88f4343",
      "organization_id" : 712,
      "first_name" : "Bob 684",
      "last_name" : "Smith 684",
      "full_name" : "Bob 684 Smith 684",
      "photo_token" : "4d4d454d-8261-44ca-bdc7-1632e7fc98f8",
      "email" : "user-693@example.com",
      "phone_number" : "+15555550690",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:05+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:05+0000",
      "updated_at" : "2016-02-09T16:09:05+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : 0.2,
      "longitude" : 0.3,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {
        "distance" : 23.38
      },
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2232,
        "addressable_id" : 703,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:05+0000",
        "updated_at" : "2016-02-09T16:09:05+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    }
  ]
}

Filter by name

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "full_name_cont" : "a b"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2873

BODY
{
  "users" : [
    {
      "id" : 679,
      "uid" : "28b4c765-5d37-4e13-a6b7-785553c66167",
      "organization_id" : 706,
      "first_name" : "A",
      "last_name" : "B",
      "full_name" : "A B",
      "photo_token" : "36f0d248-5d2b-4ccf-a9ad-07d162b4efb4",
      "email" : "user-672@example.com",
      "phone_number" : "+15555550669",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:03+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:03+0000",
      "updated_at" : "2016-02-09T16:09:03+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2214,
        "addressable_id" : 679,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:03+0000",
        "updated_at" : "2016-02-09T16:09:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    },
    {
      "id" : 678,
      "uid" : "1d5c64c0-4976-44a7-926d-3065b4d5e331",
      "organization_id" : 706,
      "first_name" : "A",
      "last_name" : "B",
      "full_name" : "A B",
      "photo_token" : "8ccb9c58-53aa-4e4c-9064-fb0af342cb11",
      "email" : "user-671@example.com",
      "phone_number" : "+15555550668",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:03+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:03+0000",
      "updated_at" : "2016-02-09T16:09:03+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2213,
        "addressable_id" : 678,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:03+0000",
        "updated_at" : "2016-02-09T16:09:03+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    }
  ]
}

Filter by phone number

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "phone_number_cont" : "111"
  },
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2929

BODY
{
  "users" : [
    {
      "id" : 699,
      "uid" : "54d0b91b-8d3c-4619-b6e0-f0d4954d6c03",
      "organization_id" : 711,
      "first_name" : "Bob 680",
      "last_name" : "Smith 680",
      "full_name" : "Bob 680 Smith 680",
      "photo_token" : "a1f7b3ae-02ed-4c56-a03e-eb9962f5f661",
      "email" : "user-689@example.com",
      "phone_number" : "+15551112222",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:04+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:04+0000",
      "updated_at" : "2016-02-09T16:09:04+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2229,
        "addressable_id" : 699,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:04+0000",
        "updated_at" : "2016-02-09T16:09:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    },
    {
      "id" : 698,
      "uid" : "4cb31239-71d3-4180-a988-f670584256db",
      "organization_id" : 711,
      "first_name" : "Bob 679",
      "last_name" : "Smith 679",
      "full_name" : "Bob 679 Smith 679",
      "photo_token" : "df8f17a0-94fa-43af-bf70-a9593cc06e2d",
      "email" : "user-688@example.com",
      "phone_number" : "+15551111111",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:04+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:04+0000",
      "updated_at" : "2016-02-09T16:09:04+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2228,
        "addressable_id" : 698,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:04+0000",
        "updated_at" : "2016-02-09T16:09:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    }
  ]
}

Filter by service types

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "service_types_contains" : [
      "electric",
      "hvac"
    ]
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2964

BODY
{
  "users" : [
    {
      "id" : 691,
      "uid" : "146696a5-6ca8-4b22-ab7d-e1fe2e68d86f",
      "organization_id" : 709,
      "first_name" : "Bob 672",
      "last_name" : "Smith 672",
      "full_name" : "Bob 672 Smith 672",
      "photo_token" : "6dca28dc-dcb1-479a-84df-907bfcb12f6d",
      "email" : "user-684@example.com",
      "phone_number" : "+15555550681",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:04+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "electric",
        "hvac",
        "roofer"
      ],
      "created_at" : "2016-02-09T16:09:04+0000",
      "updated_at" : "2016-02-09T16:09:04+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2223,
        "addressable_id" : 691,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:04+0000",
        "updated_at" : "2016-02-09T16:09:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    },
    {
      "id" : 690,
      "uid" : "e2f65e67-9397-4d34-9a35-e97001f89517",
      "organization_id" : 709,
      "first_name" : "Bob 671",
      "last_name" : "Smith 671",
      "full_name" : "Bob 671 Smith 671",
      "photo_token" : "830b6168-9682-430f-80c8-719d2dfa7935",
      "email" : "user-683@example.com",
      "phone_number" : "+15555550680",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:04+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber",
        "electric",
        "hvac"
      ],
      "created_at" : "2016-02-09T16:09:04+0000",
      "updated_at" : "2016-02-09T16:09:04+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2222,
        "addressable_id" : 690,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:04+0000",
        "updated_at" : "2016-02-09T16:09:04+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : []
    }
  ]
}

List users

Returns a list of Users.

Parameters

Parameter Required Type Description
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates

Request

ROUTE
GET /v1/users
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

3046

BODY
{
  "users" : [
    {
      "id" : 665,
      "uid" : "ab474202-9d10-4095-98e1-1cf77573c447",
      "organization_id" : 700,
      "first_name" : "Bob 649",
      "last_name" : "Smith 649",
      "full_name" : "Bob 649 Smith 649",
      "photo_token" : "b80e14a9-bd47-4ab0-b735-4c597b233529",
      "email" : "user-658@example.com",
      "phone_number" : "+15555550655",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:02+0000",
      "occupation" : "electrician",
      "roles" : [
        "technician"
      ],
      "service_types" : [
        "plumber"
      ],
      "created_at" : "2016-02-09T16:09:02+0000",
      "updated_at" : "2016-02-09T16:09:02+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : {
        "id" : 2202,
        "addressable_id" : 665,
        "addressable_type" : "User",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States",
        "latitude" : 40.7143528,
        "longitude" : -74.0059731,
        "created_at" : "2016-02-09T16:09:02+0000",
        "updated_at" : "2016-02-09T16:09:02+0000",
        "version" : "v1",
        "updated_by" : "system"
      },
      "profiles" : [
        {
          "id" : 23,
          "user_id" : 665,
          "organization_id" : 700,
          "account_id" : null,
          "is_active" : true,
          "custom_fields" : {},
          "roles" : [],
          "first_name" : "Mike-19",
          "last_name" : "Prof-19",
          "full_name" : "Mike-19 Prof-19",
          "photo_token" : null,
          "email" : "profile-19@example.com",
          "phone_numbers" : [
            {
              "number" : "+15555550019",
              "type" : "Mobile",
              "primary" : true
            }
          ],
          "service_types" : [],
          "external_ids" : [],
          "created_at" : "2016-02-09T16:09:02+0000",
          "updated_at" : "2016-02-09T16:09:02+0000",
          "version" : "v1",
          "updated_by" : "system"
        }
      ]
    },
    {
      "id" : 664,
      "uid" : "99978ecd-d13b-4783-aa0e-5fc5061ea214",
      "organization_id" : 700,
      "first_name" : "Bob 648",
      "last_name" : "Smith 648",
      "full_name" : "Bob 648 Smith 648",
      "photo_token" : "4e0cf94a-e118-4936-a974-fcba7b35e2ef",
      "email" : "user-657@example.com",
      "phone_number" : "+15555550654",
      "mobile_verified" : true,
      "mobile_verified_at" : "2016-02-09T16:09:02+0000",
      "occupation" : "electrician",
      "roles" : [
        "dispatcher"
      ],
      "service_types" : [],
      "created_at" : "2016-02-09T16:09:02+0000",
      "updated_at" : "2016-02-09T16:09:02+0000",
      "working_hours" : {
        "0" : [],
        "1" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "2" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "3" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "4" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "5" : [
          "08:00:00 - 11:59:59",
          "12:00:00 - 15:59:59"
        ],
        "6" : []
      },
      "latitude" : null,
      "longitude" : null,
      "address_resolved" : null,
      "notes" : null,
      "custom_fields" : {},
      "is_admin" : false,
      "last_sign_in_at" : null,
      "is_available_for_job_offers" : true,
      "deleted_at" : null,
      "timezone" : "Eastern Time (US & Canada)",
      "meta" : {},
      "is_configured" : true,
      "version" : "v1",
      "updated_by" : "system",
      "external_ids" : [],
      "address" : null,
      "profiles" : []
    }
  ]
}

Disable user

Disables the specified User

Request

ROUTE
DELETE /v1/users/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "663"
}
BODY
{}

Response

Update user

Updates specified User with given parameters

Parameters

Parameter Required Type Description
first_name optional String First Name of a customer
last_name optional String Last Name of a customer
full_name optional String when not set, full_name will be build by combining first and last name.
Otherwise it may be passed here
roles optional Array of String Role of the user: "dispatcher" or "technician"
phone_number optional String For technician only
mobile_verified optional Boolean when true, phone_number is confirmed to be mobile
mobile_verified_at optional Date time overwrite time when phone number was confirmed to be mobile
email optional String For dispatcher only
password optional String Password to login in web interface
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity
service_types optional Array of String List of service types enabled for technician role
(must be subset of organization's service types)
is_available_for_job_offers optional Boolean Indicates if user accepts jobs
deleted_at optional DateTime can be set blank to re-enable previously deleted user.
in this case "roles" array also should be passed, along with other necessary for role params, like "service_types"

Request

ROUTE
PATCH /v1/users/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "724"
}
BODY
{
  "first_name" : "James",
  "last_name" : "Smith",
  "email" : "new_email@example.com",
  "occupation" : "Just worker",
  "phone_number" : "5555599999",
  "timezone" : "Pacific Time (US & Canada)",
  "address" : {
    "street_1" : "1st Avenue",
    "street_2" : "apt 5",
    "postal_code" : "02110",
    "city" : "Boston",
    "state" : "MA",
    "latitude" : 1.13,
    "longitude" : 3.17
  },
  "working_hours" : {
    "0" : null,
    "1" : [
      "2:00 - 15:00",
      "16:00 - 20:00"
    ],
    "2" : [
      "15:00 - 16:00"
    ],
    "3" : [
      "16:00 - 17:00"
    ],
    "4" : [
      "17:00 - 18:00"
    ],
    "5" : [
      "18:00 - 19:00"
    ],
    "6" : null
  },
  "custom_fields" : {
    "key49" : "new value"
  },
  "roles" : [
    "dispatcher",
    "technician"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

1468

BODY
{
  "user" : {
    "id" : 724,
    "uid" : "3ee48127-bf5c-4fe8-b115-11d3ab166ac3",
    "organization_id" : 723,
    "first_name" : "James",
    "last_name" : "Smith",
    "full_name" : "James Smith",
    "photo_token" : "f6a78f0c-966c-4d48-b463-4d17e0f9b245",
    "email" : "new_email@example.com",
    "phone_number" : "+15555599999",
    "mobile_verified" : true,
    "mobile_verified_at" : "2016-02-09T16:09:07+0000",
    "occupation" : "Just worker",
    "roles" : [
      "technician",
      "dispatcher"
    ],
    "service_types" : [
      "plumber"
    ],
    "created_at" : "2016-02-09T16:09:06+0000",
    "updated_at" : "2016-02-09T16:09:07+0000",
    "working_hours" : {
      "0" : [],
      "1" : [
        "02:00:00 - 15:00:00",
        "16:00:00 - 20:00:00"
      ],
      "2" : [
        "15:00:00 - 16:00:00"
      ],
      "3" : [
        "16:00:00 - 17:00:00"
      ],
      "4" : [
        "17:00:00 - 18:00:00"
      ],
      "5" : [
        "18:00:00 - 19:00:00"
      ],
      "6" : []
    },
    "latitude" : 1.13,
    "longitude" : 3.17,
    "address_resolved" : "Boston, MA 02110",
    "notes" : null,
    "custom_fields" : {
      "key49" : "new value"
    },
    "is_admin" : false,
    "last_sign_in_at" : null,
    "is_available_for_job_offers" : true,
    "deleted_at" : null,
    "timezone" : "Pacific Time (US & Canada)",
    "meta" : {},
    "is_configured" : true,
    "version" : "v1",
    "updated_by" : "user:fc8cd652-42c5-4670-9183-d4dba09067f7",
    "external_ids" : [],
    "address" : {
      "id" : 2246,
      "addressable_id" : 724,
      "addressable_type" : "User",
      "street_1" : "1st Avenue",
      "street_2" : "apt 5",
      "postal_code" : "02110",
      "city" : "Boston",
      "state" : "MA",
      "country" : "United States",
      "latitude" : 1.13,
      "longitude" : 3.17,
      "created_at" : "2016-02-09T16:09:07+0000",
      "updated_at" : "2016-02-09T16:09:07+0000",
      "version" : "v1",
      "updated_by" : "user:fc8cd652-42c5-4670-9183-d4dba09067f7"
    },
    "profiles" : []
  }
}

Notify user

Sends given notification again to specified user

Parameters

Parameter Required Type Description
event_action required String Actions that can be sent again.
Current available actions: created

Request

ROUTE
PATCH /v1/users/:id/notify
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "718"
}
BODY
{
  "event_action" : "created"
}

Response

Update user location

Create a location record for a specified user

Parameters

Parameter Required Type Description
lat required Integer Latitude of the location
lng required Integer Longitude of the location
address optional String Address of the location

Request

ROUTE
POST /v1/users/:user_id/locations
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "user_id" : "417"
}
BODY
{
  "lat" : 1.1,
  "lng" : 1.3,
  "address" : "Boston, MA"
}

Response

HEADERS
Content-Type

text/plain; charset=utf-8

Content-Length

0

User Profile

Create profile

Creates a Profile for given User inside Account or Organization all user properties will work only for given Account or Organization

Parameters

Parameter Required Type Description
user_id required Integer User ID
organization_id optional Integer Organization ID
account_id optional Integer Account ID
is_active optional Boolean When false, User could not use this Profile
roles required Array of String Role of the user: "dispatcher" or "technician" inside
first_name required String First Name of the user
last_name optional String Last Name of the user
photo_token optional UUID Photo image token (UUID)
email optional String User email
Email must be unique on dispatch
phone_numbers optional JSON List of phone numbers and their properties
Example: { '+15551234567': { 'type': 'Mobile', 'primary': true } }
Number must be unique on dispatch
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity
service_types optional Array of String List of service types enabled for technician role.
Must be subset of Organization's service type keys

Request

ROUTE
POST /v1/profiles
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "user_id" : 474,
  "account_id" : 140,
  "first_name" : "Mike",
  "last_name" : "Smith",
  "roles" : [
    "dispatcher",
    "technician"
  ],
  "is_active" : false,
  "photo_token" : "xxxx",
  "email" : "profile@example.com",
  "phone_numbers" : {
    "+15551111111" : {
      "number" : "+15551111111",
      "type" : "Mobile",
      "primary" : false
    }
  },
  "custom_fields" : {
    "key43" : "new value"
  },
  "service_types" : [
    "plumber"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

558

BODY
{
  "profile" : {
    "id" : 1,
    "user_id" : 474,
    "organization_id" : null,
    "account_id" : 140,
    "is_active" : false,
    "custom_fields" : {
      "key43" : "new value"
    },
    "roles" : [
      "technician",
      "dispatcher"
    ],
    "first_name" : "Mike",
    "last_name" : "Smith",
    "full_name" : "Mike Smith",
    "photo_token" : "xxxx",
    "email" : "profile@example.com",
    "phone_numbers" : [
      {
        "number" : "+15551111111",
        "type" : "Mobile",
        "primary" : true
      }
    ],
    "service_types" : [
      "plumber"
    ],
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:35+0000",
    "updated_at" : "2016-02-09T16:08:35+0000",
    "version" : "v1",
    "updated_by" : "account:87046f4a-6055-457a-bedc-858f9fa496eb"
  }
}

Filter by account

Returns a list of Profiles of given User, Organization or Account.

Parameters

Parameter Required Type Description
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
filter[user_id_eq] optional Integer ID of User whose profiles should be loaded
usually it makes sense to load profile of User in scope of Account or Organization
filter[account_id_eq] optional Integer ID of Account whose profiles should be loaded
filter[organization_id_eq] optional Integer ID of Organization whose profiles should be loaded
roles required Array of String Role of the user: "dispatcher" or "technician"

Request

ROUTE
GET /v1/profiles
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "account_id_eq" : "146"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

481

BODY
{
  "profiles" : [
    {
      "id" : 13,
      "user_id" : 495,
      "organization_id" : null,
      "account_id" : 146,
      "is_active" : null,
      "custom_fields" : {},
      "roles" : [],
      "first_name" : "Mike-12",
      "last_name" : "Prof-12",
      "full_name" : "Mike-12 Prof-12",
      "photo_token" : null,
      "email" : "profile-12@example.com",
      "phone_numbers" : [
        {
          "number" : "+15555550012",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "service_types" : [],
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:37+0000",
      "updated_at" : "2016-02-09T16:08:37+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Filter by organization

Returns a list of Profiles of given User, Organization or Account.

Parameters

Parameter Required Type Description
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
filter[user_id_eq] optional Integer ID of User whose profiles should be loaded
usually it makes sense to load profile of User in scope of Account or Organization
filter[account_id_eq] optional Integer ID of Account whose profiles should be loaded
filter[organization_id_eq] optional Integer ID of Organization whose profiles should be loaded
roles required Array of String Role of the user: "dispatcher" or "technician"

Request

ROUTE
GET /v1/profiles
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "organization_id_eq" : "573"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

481

BODY
{
  "profiles" : [
    {
      "id" : 11,
      "user_id" : 492,
      "organization_id" : 573,
      "account_id" : null,
      "is_active" : null,
      "custom_fields" : {},
      "roles" : [],
      "first_name" : "Mike-10",
      "last_name" : "Prof-10",
      "full_name" : "Mike-10 Prof-10",
      "photo_token" : null,
      "email" : "profile-10@example.com",
      "phone_numbers" : [
        {
          "number" : "+15555550010",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "service_types" : [],
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:37+0000",
      "updated_at" : "2016-02-09T16:08:37+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Filter by user

Returns a list of Profiles of given User, Organization or Account.

Parameters

Parameter Required Type Description
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
filter[user_id_eq] optional Integer ID of User whose profiles should be loaded
usually it makes sense to load profile of User in scope of Account or Organization
filter[account_id_eq] optional Integer ID of Account whose profiles should be loaded
filter[organization_id_eq] optional Integer ID of Organization whose profiles should be loaded
roles required Array of String Role of the user: "dispatcher" or "technician"

Request

ROUTE
GET /v1/profiles
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "id_eq" : "9"
  }
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

475

BODY
{
  "profiles" : [
    {
      "id" : 9,
      "user_id" : 489,
      "organization_id" : 572,
      "account_id" : null,
      "is_active" : null,
      "custom_fields" : {},
      "roles" : [],
      "first_name" : "Mike-8",
      "last_name" : "Prof-8",
      "full_name" : "Mike-8 Prof-8",
      "photo_token" : null,
      "email" : "profile-8@example.com",
      "phone_numbers" : [
        {
          "number" : "+15555550008",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "service_types" : [],
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:37+0000",
      "updated_at" : "2016-02-09T16:08:37+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

List Profiles

Returns a list of Profiles of given User, Organization or Account.

Parameters

Parameter Required Type Description
filter required Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
filter[user_id_eq] optional Integer ID of User whose profiles should be loaded
usually it makes sense to load profile of User in scope of Account or Organization
filter[account_id_eq] optional Integer ID of Account whose profiles should be loaded
filter[organization_id_eq] optional Integer ID of Organization whose profiles should be loaded
roles required Array of String Role of the user: "dispatcher" or "technician"

Request

ROUTE
GET /v1/profiles
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "id desc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

936

BODY
{
  "profiles" : [
    {
      "id" : 7,
      "user_id" : 486,
      "organization_id" : 570,
      "account_id" : null,
      "is_active" : null,
      "custom_fields" : {},
      "roles" : [],
      "first_name" : "Mike-6",
      "last_name" : "Prof-6",
      "full_name" : "Mike-6 Prof-6",
      "photo_token" : null,
      "email" : "profile-6@example.com",
      "phone_numbers" : [
        {
          "number" : "+15555550006",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "service_types" : [],
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:37+0000",
      "updated_at" : "2016-02-09T16:08:37+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 6,
      "user_id" : 485,
      "organization_id" : 570,
      "account_id" : null,
      "is_active" : null,
      "custom_fields" : {},
      "roles" : [],
      "first_name" : "Mike-5",
      "last_name" : "Prof-5",
      "full_name" : "Mike-5 Prof-5",
      "photo_token" : null,
      "email" : "profile-5@example.com",
      "phone_numbers" : [
        {
          "number" : "+15555550005",
          "type" : "Mobile",
          "primary" : true
        }
      ],
      "service_types" : [],
      "external_ids" : [],
      "created_at" : "2016-02-09T16:08:37+0000",
      "updated_at" : "2016-02-09T16:08:37+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Delete profile

Removes specified Profile User will be unlinked from Organization or Account

Request

ROUTE
DELETE /v1/profiles/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "4"
}
BODY
{}

Response

Update profile

Updates properties of specified Profile

Parameters

Parameter Required Type Description
id required Integer Profile ID
is_active optional Boolean When false, User could not use this Profile
roles optional Array of String Role of the user: "dispatcher" or "technician" inside
first_name optional String First Name of the user
last_name optional String Last Name of the user
photo_token optional UUID Photo image token (UUID)
email optional String User email
Email must be unique on dispatch
phone_numbers optional JSON List of phone numbers and their properties
Example: { '+15551234567': { 'type': 'Mobile', 'primary': true } }
Number must be unique on dispatch
custom_fields optional Hash Hash of custom field values.
List of existing custom fields is defined on Organization level.
Key of the hash indicates canonical name of the Custom Field.
Value indicates a value for that field of the current entity
service_types optional Array of String List of service types enabled for technician role.
Must be subset of Organization's service type keys

Request

ROUTE
PATCH /v1/profiles/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "18"
}
BODY
{
  "first_name" : "Mike",
  "last_name" : "Smith",
  "is_active" : false,
  "roles" : [
    "dispatcher"
  ],
  "photo_token" : "yyyyy",
  "email" : "mike@example.com",
  "phone_numbers" : {
    "+15552222222" : {
      "number" : "+15552222222",
      "type" : "Home",
      "primary" : true
    }
  },
  "custom_fields" : {
    "key44" : "new value"
  },
  "service_types" : [
    "hvac"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

536

BODY
{
  "profile" : {
    "id" : 18,
    "user_id" : 501,
    "organization_id" : 579,
    "account_id" : null,
    "is_active" : false,
    "custom_fields" : {
      "key44" : "new value"
    },
    "roles" : [
      "dispatcher"
    ],
    "first_name" : "Mike",
    "last_name" : "Smith",
    "full_name" : "Mike Smith",
    "photo_token" : "yyyyy",
    "email" : "mike@example.com",
    "phone_numbers" : [
      {
        "number" : "+15552222222",
        "type" : "Home",
        "primary" : true
      }
    ],
    "service_types" : [
      "hvac"
    ],
    "external_ids" : [],
    "created_at" : "2016-02-09T16:08:38+0000",
    "updated_at" : "2016-02-09T16:08:38+0000",
    "version" : "v1",
    "updated_by" : "user:aefd1bcd-ffc4-4d58-8a27-001316f941e1"
  }
}

Spreedly Gateway

List Gateways

Creates a SpreedlyGateway for given Organization

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
spreedly_gateway required String that represent Spreedly type of gateway
active optional Boolean Activates and Deactivates the gateway.
When you create a new Active gateway old ones will be marked as Deactivated
credentials required Hash with credentials for given gateway

Request

ROUTE
POST /v1/spreedly_gateways
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 600,
  "type" : "test",
  "credentials" : {
    "login" : "sk_test_abc"
  },
  "active" : true
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

270

BODY
{
  "spreedly_gateway" : {
    "id" : 23,
    "token" : "1BvvpQV7JST2qy4TqUBMPyky8OD",
    "organization_id" : 600,
    "type" : "test",
    "active" : true,
    "created_at" : "2016-02-09T16:08:42+0000",
    "updated_at" : "2016-02-09T16:08:42+0000",
    "version" : "v1",
    "updated_by" : "user:55eb7f28-2dac-4625-99ea-6dbc818cc557"
  }
}

List Payment Gateways

Returns the List of SpreedlyGateways by given set of filters

Request

ROUTE
GET /v1/spreedly_gateways
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

403

BODY
{
  "spreedly_gateways" : [
    {
      "id" : 31,
      "token" : null,
      "organization_id" : 613,
      "type" : "test",
      "active" : null,
      "created_at" : "2016-02-09T16:08:43+0000",
      "updated_at" : "2016-02-09T16:08:43+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 30,
      "token" : null,
      "organization_id" : 613,
      "type" : "test",
      "active" : null,
      "created_at" : "2016-02-09T16:08:43+0000",
      "updated_at" : "2016-02-09T16:08:43+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Paginated spreedly_gateways

Returns the List of SpreedlyGateways by given set of filters

Request

ROUTE
GET /v1/spreedly_gateways
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "offset" : "1",
  "limit" : "2",
  "sort" : "created_at asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

403

BODY
{
  "spreedly_gateways" : [
    {
      "id" : 58,
      "token" : null,
      "organization_id" : 625,
      "type" : "test",
      "active" : null,
      "created_at" : "2016-02-09T12:08:44+0000",
      "updated_at" : "2016-02-09T16:08:44+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 59,
      "token" : null,
      "organization_id" : 625,
      "type" : "test",
      "active" : null,
      "created_at" : "2016-02-09T13:08:44+0000",
      "updated_at" : "2016-02-09T16:08:44+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Sorted spreedly_gateways

Returns the List of SpreedlyGateways by given set of filters

Request

ROUTE
GET /v1/spreedly_gateways
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "sort" : "id asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

403

BODY
{
  "spreedly_gateways" : [
    {
      "id" : 51,
      "token" : null,
      "organization_id" : 621,
      "type" : "test",
      "active" : null,
      "created_at" : "2016-02-09T16:08:44+0000",
      "updated_at" : "2016-02-09T16:08:44+0000",
      "version" : "v1",
      "updated_by" : "system"
    },
    {
      "id" : 52,
      "token" : null,
      "organization_id" : 621,
      "type" : "test",
      "active" : null,
      "created_at" : "2016-02-09T16:08:44+0000",
      "updated_at" : "2016-02-09T16:08:44+0000",
      "version" : "v1",
      "updated_by" : "system"
    }
  ]
}

Remove Payment Gateway

Removes specified SpreedlyGateway

Request

ROUTE
DELETE /v1/spreedly_gateways/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "26"
}
BODY
{}

Response

Update Payment Gateway

Updates specified SpreedlyGateway

Parameters

Parameter Required Type Description
active optional Boolean Activates and Deactivates the Gateway.
If you Activates a some Gateway all others will be Deactivated

Request

ROUTE
PATCH /v1/spreedly_gateways/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "61"
}
BODY
{
  "active" : true
}

Response

HEADERS
Content-Type

text/html; charset=utf-8

Availability

Location based availability

Get available Time Slots for a given set of parameters. This method can use standard filters for users, including filter[by_radius]

Parameters

Parameter Required Type Description
filter[id_in] optional Array of Integer Limit selection to a given user IDs
filter[organization_id_in] optional Array of Integer Limit selection to a given organization IDs
filter[by_service_type] optional Array of String Service types of technicians
duration required Integer Expected free time in seconds
start_time required DateTime Start time of period when Technician must be available.
Current time will be used if start_time is in the past
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
end_time required DateTime End of period when Technician must be available
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
group_availability_by required String How to output result?
Possible values: 'user', 'organization'
When 'organization' only organization availability would be calculated. Will return only fully available blocks.
For example: at 8am, block which includes 8am would be omitted and only next will be returned.
When 'user' is given results will be returned by technician
filter[address] optional String Full address string for geocoding.
Detect drive-time availability for this address. Drive time
availability settings should be enabled in Organization settings.
Available for group_availability_by=organization

Request

ROUTE
GET /v1/time_slots
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "organization_id_in" : "658",
    "address" : "170 Freeman Street, Brookline, MA"
  },
  "start_time" : "2014-11-25T08:00:00-0500",
  "end_time" : "2014-11-25T18:00:00-0500",
  "duration" : "3600",
  "group_availability_by" : "organization"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

192

BODY
{
  "records" : [
    {
      "organization_id" : 658,
      "time_slots" : [
        {
          "start" : "2014-11-25T08:00:00-0500",
          "end" : "2014-11-25T11:59:59-0500"
        },
        {
          "start" : "2014-11-25T12:00:00-0500",
          "end" : "2014-11-25T15:59:59-0500"
        }
      ]
    }
  ]
}

Organization availability

Get available Time Slots for a given set of parameters. This method can use standard filters for users, including filter[by_radius]

Parameters

Parameter Required Type Description
filter[id_in] optional Array of Integer Limit selection to a given user IDs
filter[organization_id_in] optional Array of Integer Limit selection to a given organization IDs
filter[by_service_type] optional Array of String Service types of technicians
duration required Integer Expected free time in seconds
start_time required DateTime Start time of period when Technician must be available.
Current time will be used if start_time is in the past
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
end_time required DateTime End of period when Technician must be available
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
group_availability_by required String How to output result?
Possible values: 'user', 'organization'
When 'organization' only organization availability would be calculated. Will return only fully available blocks.
For example: at 8am, block which includes 8am would be omitted and only next will be returned.
When 'user' is given results will be returned by technician
filter[address] optional String Full address string for geocoding.
Detect drive-time availability for this address. Drive time
availability settings should be enabled in Organization settings.
Available for group_availability_by=organization

Request

ROUTE
GET /v1/time_slots
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "start_time" : "2012-11-23T08:00:00-0500",
  "end_time" : "2012-11-23T18:00:00-0500",
  "duration" : "3600",
  "group_availability_by" : "organization",
  "sort" : "id asc"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

371

BODY
{
  "records" : [
    {
      "organization_id" : 646,
      "time_slots" : [
        {
          "start" : "2012-11-23T08:00:00-0500",
          "end" : "2012-11-23T11:59:59-0500"
        },
        {
          "start" : "2012-11-23T12:00:00-0500",
          "end" : "2012-11-23T15:59:59-0500"
        }
      ]
    },
    {
      "organization_id" : 647,
      "time_slots" : [
        {
          "start" : "2012-11-23T08:00:00-0500",
          "end" : "2012-11-23T11:59:59-0500"
        },
        {
          "start" : "2012-11-23T12:00:00-0500",
          "end" : "2012-11-23T15:59:59-0500"
        }
      ]
    }
  ]
}

Organization paused jobs

Get available Time Slots for a given set of parameters. This method can use standard filters for users, including filter[by_radius]

Parameters

Parameter Required Type Description
filter[id_in] optional Array of Integer Limit selection to a given user IDs
filter[organization_id_in] optional Array of Integer Limit selection to a given organization IDs
filter[by_service_type] optional Array of String Service types of technicians
duration required Integer Expected free time in seconds
start_time required DateTime Start time of period when Technician must be available.
Current time will be used if start_time is in the past
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
end_time required DateTime End of period when Technician must be available
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
group_availability_by required String How to output result?
Possible values: 'user', 'organization'
When 'organization' only organization availability would be calculated. Will return only fully available blocks.
For example: at 8am, block which includes 8am would be omitted and only next will be returned.
When 'user' is given results will be returned by technician
filter[address] optional String Full address string for geocoding.
Detect drive-time availability for this address. Drive time
availability settings should be enabled in Organization settings.
Available for group_availability_by=organization

Request

ROUTE
GET /v1/time_slots
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "organization_id_in" : [
      "656"
    ]
  },
  "start_time" : "2014-12-11T00:00:00-0600",
  "end_time" : "2014-12-12T23:00:00-0600",
  "duration" : "3600",
  "group_availability_by" : "organization"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

14

BODY
{
  "records" : []
}

User availability

Get available Time Slots for a given set of parameters. This method can use standard filters for users, including filter[by_radius]

Parameters

Parameter Required Type Description
filter[id_in] optional Array of Integer Limit selection to a given user IDs
filter[organization_id_in] optional Array of Integer Limit selection to a given organization IDs
filter[by_service_type] optional Array of String Service types of technicians
duration required Integer Expected free time in seconds
start_time required DateTime Start time of period when Technician must be available.
Current time will be used if start_time is in the past
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
end_time required DateTime End of period when Technician must be available
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
group_availability_by required String How to output result?
Possible values: 'user', 'organization'
When 'organization' only organization availability would be calculated. Will return only fully available blocks.
For example: at 8am, block which includes 8am would be omitted and only next will be returned.
When 'user' is given results will be returned by technician
filter[address] optional String Full address string for geocoding.
Detect drive-time availability for this address. Drive time
availability settings should be enabled in Organization settings.
Available for group_availability_by=organization

Request

ROUTE
GET /v1/time_slots
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "filter" : {
    "by_service_type" : "plumber"
  },
  "start_time" : "2012-11-23T08:00:00-0500",
  "end_time" : "2012-11-23T18:00:00-0500",
  "duration" : "3600",
  "group_availability_by" : "user"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

285

BODY
{
  "records" : [
    {
      "user_id" : 594,
      "time_slots" : [
        {
          "start" : "2012-11-23T08:00:00-0500",
          "end" : "2012-11-23T09:00:00-0500"
        },
        {
          "start" : "2012-11-23T10:00:00-0500",
          "end" : "2012-11-23T13:30:00-0500"
        }
      ]
    },
    {
      "user_id" : 592,
      "time_slots" : [
        {
          "start" : "2012-11-23T13:15:00-0500",
          "end" : "2012-11-23T15:59:59-0500"
        }
      ]
    }
  ]
}

Billing Contract V2

List Billing Contracts

List of Billing Contracts for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='title asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_group][column]= Select a column to apply aggregate function
- filter[by_group][aggregate]= Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]= Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v2/billing_contracts
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

701

BODY
{
  "billing_contracts" : [
    {
      "id" : null,
      "title" : "Generic Contract",
      "text" : "By signing this document, the customer agrees to the services and conditions outlined in this document.",
      "default" : true,
      "organization_id" : null,
      "created_at" : null,
      "updated_at" : null,
      "version" : "v2",
      "updated_by" : null
    },
    {
      "id" : 5,
      "title" : "Title-4",
      "text" : "Text-4 foo bar baz",
      "default" : true,
      "organization_id" : 759,
      "created_at" : "2016-02-09T16:09:12+0000",
      "updated_at" : "2016-02-09T16:09:12+0000",
      "version" : "v2",
      "updated_by" : "system"
    },
    {
      "id" : 4,
      "title" : "Title-3",
      "text" : "Text-3 foo bar baz",
      "default" : false,
      "organization_id" : 759,
      "created_at" : "2016-02-09T16:09:12+0000",
      "updated_at" : "2016-02-09T16:09:12+0000",
      "version" : "v2",
      "updated_by" : "system"
    }
  ]
}

List Billing Contracts

Creates a Billing Contract for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
title required String A title of the billing contract
text required String A text for the billing contract
default required Boolean Marks billing contract as default

Request

ROUTE
POST /v2/billing_contracts
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 753,
  "title" : "foo",
  "text" : "bar",
  "default" : true
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

245

BODY
{
  "billing_contract" : {
    "id" : 1,
    "title" : "foo",
    "text" : "bar",
    "default" : true,
    "organization_id" : 753,
    "created_at" : "2016-02-09T16:09:12+0000",
    "updated_at" : "2016-02-09T16:09:12+0000",
    "version" : "v2",
    "updated_by" : "user:c65f591b-fdb4-492d-963e-7d4b69a7e4e8"
  }
}

Remove Billing Contract

Deletes a Billing Contract.

Request

ROUTE
DELETE /v2/billing_contracts/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "2"
}
BODY
{}

Response

Update Billing Contract

Updates a Billing Contract for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
title required String A title of the billing contract
text required String A text for the billing contract
default required Boolean Marks billing contract as default

Request

ROUTE
PATCH /v2/billing_contracts/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "21"
}
BODY
{
  "default" : true
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

267

BODY
{
  "billing_contract" : {
    "id" : 21,
    "title" : "Title-19",
    "text" : "Text-20 foo bar baz",
    "default" : true,
    "organization_id" : 768,
    "created_at" : "2016-02-09T16:09:13+0000",
    "updated_at" : "2016-02-09T16:09:13+0000",
    "version" : "v2",
    "updated_by" : "user:62785bf0-84f7-44f6-b55d-ec125a60e8ea"
  }
}

Billing Document V2

Create Estimate

Creates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
job_id required Integer Invoice will be attached to a given Job ID
doc_type required String Type of the Billing Document: Invoice or Estimate
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_amount optional Integer The value of discount in cents. If present
discount_percent will not apply.
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
external_number optional String Custom ID
po_number optional String PO Number
estimated_start_on optional Date Estimated Start Date
issued_on optional Date Date Issued
organization_signature optional Bytes Service Provider signature
Required if document is not 'draft' or 'lost' unless skip_organization_signature is set to true
skip_organization_signature optional Boolean If Service Provider signature unnecessary
contract optional Text General Contract
payment_terms optional Text Payment Terms
apply_tax_after_discount optional Boolean Determine tax applying logic
line_item_level_tax optional Boolean Determine line_item tax level
tax_rates optional JSON see /v2/tax_rates. Important! No partial updates allowed.
lines optional Lines should be provided always in full.
Important! No partial updates allowed.
lines[][id] required String UUID for line item
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional JSON see /v2/tax_rates
lines[][taxable] optional Boolean Represent ability to be taxed
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed

Request

ROUTE
POST /v2/billing_documents
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "organization_id" : 795,
  "job_id" : 441,
  "doc_type" : "Estimate",
  "description" : "Toilet flooding",
  "due_date" : "2016-02-23T16:09:20+00:00",
  "customer" : {
    "customer_id" : 541,
    "first_name" : "John-563",
    "last_name" : "Doe-545",
    "full_name" : "John-563 Doe-545",
    "company_name" : "Company-577",
    "phone_number" : "+15555550572",
    "email" : "customer-568@example.com",
    "address" : {
      "attention_to" : "John-563 Doe-545",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "payee" : {
    "full_name" : "John-565 Doe-547",
    "phone_number" : "+15555550574",
    "company_name" : "Company-579",
    "email" : "customer-570@example.com",
    "address" : {
      "attention_to" : "John-565 Doe-547",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "discount_amount" : {
    "currency" : "USD",
    "value" : 1,
    "text" : "$0.00"
  },
  "discount_percent" : 0.25,
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-12-31T16:00:00+00:00",
  "issued_at" : "2015-12-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Tiny note",
  "lines" : [
    {
      "billing_item_id" : 9,
      "title" : "item1",
      "taxable" : true,
      "description" : "pipes",
      "qty" : 10,
      "price" : {
        "value" : 10.1,
        "currency" : "USD",
        "text" : "$10.10"
      }
    },
    {
      "description" : "drive to client and back",
      "title" : "item2",
      "qty" : 10,
      "price" : 10
    },
    {
      "description" : "expect 1h labor",
      "title" : "item3",
      "qty" : 1,
      "price" : "100 USD",
      "taxable" : false
    },
    {
      "description" : "expect 2h labor",
      "title" : "item4",
      "qty" : 1,
      "price" : {
        "value" : "100",
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : {
        "name" : "foo",
        "organization_id" : 795,
        "rate_details" : [
          {
            "id" : "1001",
            "name" : "VAT",
            "rate" : 0.05
          },
          {
            "id" : "1002",
            "name" : "n5",
            "rate" : 0.05
          }
        ]
      }
    }
  ],
  "tax_rate" : {
    "name" : "foo",
    "organization_id" : 795,
    "rate_details" : [
      {
        "id" : "1001",
        "name" : "VAT",
        "rate" : 0.025
      },
      {
        "id" : "1002",
        "name" : "n5",
        "rate" : 0.025
      }
    ],
    "extra_field" : "should be ignored"
  },
  "external_ids" : null,
  "extra_field" : "should be ignored"
}
BODY
{
  "organization_id" : 795,
  "job_id" : 441,
  "doc_type" : "Estimate",
  "description" : "Toilet flooding",
  "due_date" : "2016-02-23T16:09:20+00:00",
  "customer" : {
    "customer_id" : 541,
    "first_name" : "John-563",
    "last_name" : "Doe-545",
    "full_name" : "John-563 Doe-545",
    "company_name" : "Company-577",
    "phone_number" : "+15555550572",
    "email" : "customer-568@example.com",
    "address" : {
      "attention_to" : "John-563 Doe-545",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "payee" : {
    "full_name" : "John-565 Doe-547",
    "phone_number" : "+15555550574",
    "company_name" : "Company-579",
    "email" : "customer-570@example.com",
    "address" : {
      "attention_to" : "John-565 Doe-547",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "discount_amount" : {
    "currency" : "USD",
    "value" : 1,
    "text" : "$0.00"
  },
  "discount_percent" : 0.25,
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-12-31T16:00:00+00:00",
  "issued_at" : "2015-12-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Tiny note",
  "lines" : [
    {
      "billing_item_id" : 9,
      "title" : "item1",
      "taxable" : true,
      "description" : "pipes",
      "qty" : 10,
      "price" : {
        "value" : 10.1,
        "currency" : "USD",
        "text" : "$10.10"
      }
    },
    {
      "description" : "drive to client and back",
      "title" : "item2",
      "qty" : 10,
      "price" : 10
    },
    {
      "description" : "expect 1h labor",
      "title" : "item3",
      "qty" : 1,
      "price" : "100 USD",
      "taxable" : false
    },
    {
      "description" : "expect 2h labor",
      "title" : "item4",
      "qty" : 1,
      "price" : {
        "value" : "100",
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : {
        "name" : "foo",
        "organization_id" : 795,
        "rate_details" : [
          {
            "id" : "1001",
            "name" : "VAT",
            "rate" : 0.05
          },
          {
            "id" : "1002",
            "name" : "n5",
            "rate" : 0.05
          }
        ]
      }
    }
  ],
  "tax_rate" : {
    "name" : "foo",
    "organization_id" : 795,
    "rate_details" : [
      {
        "id" : "1001",
        "name" : "VAT",
        "rate" : 0.025
      },
      {
        "id" : "1002",
        "name" : "n5",
        "rate" : 0.025
      }
    ],
    "extra_field" : "should be ignored"
  },
  "external_ids" : [],
  "extra_field" : "should be ignored"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4286

BODY
{
  "billing_document" : {
    "id" : 114,
    "status" : "draft",
    "doc_type" : "Estimate",
    "number" : "160209441",
    "job_id" : 441,
    "organization_id" : 795,
    "title" : null,
    "description" : "Toilet flooding",
    "discount_amount" : {
      "value" : "1.00",
      "currency" : "USD",
      "text" : "$1.00"
    },
    "discount_percent" : "0.25",
    "paid" : false,
    "subtotal" : {
      "value" : "401.00",
      "currency" : "USD",
      "text" : "$401.00"
    },
    "tax_amount" : {
      "value" : "20.05",
      "currency" : "USD",
      "text" : "$20.05"
    },
    "total" : {
      "value" : "420.05",
      "currency" : "USD",
      "text" : "$420.05"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2016-02-09T16:09:20+0000",
    "updated_at" : "2016-02-09T16:09:20+0000",
    "customer_signature" : null,
    "skip_customer_signature" : false,
    "customer_signed_at" : null,
    "invoice_id" : null,
    "attachment_id" : null,
    "estimated_start_at" : "2016-12-31T16:00:00+0000",
    "issued_at" : "2015-12-31T14:00:00+0000",
    "contract" : "foo",
    "payment_terms" : "bar",
    "job_title" : "Job Title 426",
    "line_item_level_tax" : true,
    "customer_full_name" : null,
    "external_ids" : [],
    "external_number" : "123456",
    "po_number" : "PO#42",
    "apply_tax_after_discount" : true,
    "organization_signature" : "Service Provider signature",
    "skip_organization_signature" : false,
    "organization_signed_at" : null,
    "note" : "Tiny note",
    "address" : null,
    "customer" : {
      "customer_id" : 541,
      "first_name" : "John-563",
      "last_name" : "Doe-545",
      "full_name" : "John-563 Doe-545",
      "company_name" : "Company-577",
      "phone_number" : "+15555550572",
      "email" : "customer-568@example.com",
      "address" : {
        "attention_to" : "John-563 Doe-545",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States"
      }
    },
    "payee" : {
      "full_name" : "John-565 Doe-547",
      "company_name" : "Company-579",
      "phone_number" : "+15555550574",
      "email" : "customer-570@example.com",
      "address" : {
        "attention_to" : "John-565 Doe-547",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States"
      }
    },
    "payer" : {
      "customer_id" : 541,
      "first_name" : "John-563",
      "last_name" : "Doe-545",
      "full_name" : "John-563 Doe-545",
      "company_name" : "Company-577",
      "phone_number" : "+15555550572",
      "email" : "customer-568@example.com",
      "address" : {
        "attention_to" : "John-563 Doe-545",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States"
      }
    },
    "tax_rate" : {
      "id" : null,
      "name" : "foo",
      "active" : false,
      "total_rate" : 0.05,
      "rate_details" : [
        {
          "id" : "1001",
          "name" : "VAT",
          "rate" : 0.025,
          "agency" : null
        },
        {
          "id" : "1002",
          "name" : "n5",
          "rate" : 0.025,
          "agency" : null
        }
      ],
      "organization_id" : null,
      "updated_by" : null
    },
    "version" : "v2",
    "updated_by" : "user:7f6fc896-5cd1-4b8d-97d1-68a22fd89ed4",
    "lines" : [
      {
        "id" : "f2cdaacb-bf91-4584-ae30-c042014f25ad",
        "appointment_id" : null,
        "title" : "item1",
        "billing_item_id" : 9,
        "qty" : 10.0,
        "description" : "pipes",
        "price" : {
          "value" : "10.10",
          "currency" : "USD",
          "text" : "$10.10"
        },
        "price_with_markup" : {
          "value" : "10.10",
          "currency" : "USD",
          "text" : "$10.10"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : true,
        "total" : {
          "value" : "106.05",
          "currency" : "USD",
          "text" : "$106.05"
        }
      },
      {
        "id" : "1eef40ad-be75-42c8-bee2-99204273efc9",
        "appointment_id" : null,
        "title" : "item2",
        "billing_item_id" : null,
        "qty" : 10.0,
        "description" : "drive to client and back",
        "price" : {
          "value" : "10.00",
          "currency" : "USD",
          "text" : "$10.00"
        },
        "price_with_markup" : {
          "value" : "10.00",
          "currency" : "USD",
          "text" : "$10.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : null,
        "total" : {
          "value" : "105.00",
          "currency" : "USD",
          "text" : "$105.00"
        }
      },
      {
        "id" : "1219d2b2-0450-4b5f-a9ad-fe5a644a6876",
        "appointment_id" : null,
        "title" : "item3",
        "billing_item_id" : null,
        "qty" : 1.0,
        "description" : "expect 1h labor",
        "price" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "price_with_markup" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : false,
        "total" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        }
      },
      {
        "id" : "72bbc99a-17c9-4182-afea-9eb26300e09d",
        "appointment_id" : null,
        "title" : "item4",
        "billing_item_id" : null,
        "qty" : 1.0,
        "description" : "expect 2h labor",
        "price" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "price_with_markup" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "markup" : 0.0,
        "tax" : {
          "id" : null,
          "name" : "foo",
          "active" : false,
          "total_rate" : 0.1,
          "rate_details" : [
            {
              "id" : "1001",
              "name" : "VAT",
              "rate" : 0.05,
              "agency" : null
            },
            {
              "id" : "1002",
              "name" : "n5",
              "rate" : 0.05,
              "agency" : null
            }
          ],
          "organization_id" : null,
          "updated_by" : null
        },
        "taxable" : null,
        "total" : {
          "value" : "110.00",
          "currency" : "USD",
          "text" : "$110.00"
        }
      }
    ]
  }
}

Create Invoice

Creates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
job_id required Integer Invoice will be attached to a given Job ID
doc_type required String Type of the Billing Document: Invoice or Estimate
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_amount optional Integer The value of discount in cents. If present
discount_percent will not apply.
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
external_number optional String Custom ID
po_number optional String PO Number
estimated_start_on optional Date Estimated Start Date
issued_on optional Date Date Issued
organization_signature optional Bytes Service Provider signature
Required if document is not 'draft' or 'lost' unless skip_organization_signature is set to true
skip_organization_signature optional Boolean If Service Provider signature unnecessary
contract optional Text General Contract
payment_terms optional Text Payment Terms
apply_tax_after_discount optional Boolean Determine tax applying logic
line_item_level_tax optional Boolean Determine line_item tax level
tax_rates optional JSON see /v2/tax_rates. Important! No partial updates allowed.
lines optional Lines should be provided always in full.
Important! No partial updates allowed.
lines[][id] required String UUID for line item
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional JSON see /v2/tax_rates
lines[][taxable] optional Boolean Represent ability to be taxed
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed

Request

ROUTE
POST /v2/billing_documents
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "organization_id" : 775,
  "job_id" : 425,
  "doc_type" : "Invoice",
  "description" : "Toilet flooding",
  "due_date" : "2016-02-23T16:09:14+00:00",
  "customer" : {
    "customer_id" : 494,
    "first_name" : "John-516",
    "last_name" : "Doe-498",
    "full_name" : "John-516 Doe-498",
    "company_name" : "Company-531",
    "phone_number" : "+15555550525",
    "email" : "customer-522@example.com",
    "address" : {
      "attention_to" : "John-516 Doe-498",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "payee" : {
    "full_name" : "John-518 Doe-500",
    "phone_number" : "+15555550527",
    "company_name" : "Company-533",
    "email" : "customer-524@example.com",
    "address" : {
      "attention_to" : "John-518 Doe-500",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "discount_amount" : {
    "currency" : "USD",
    "value" : 1,
    "text" : "$0.00"
  },
  "discount_percent" : 0.25,
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-12-31T16:00:00+00:00",
  "issued_at" : "2015-12-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Tiny note",
  "lines" : [
    {
      "billing_item_id" : 1,
      "title" : "item1",
      "taxable" : true,
      "description" : "pipes",
      "qty" : 10,
      "price" : {
        "value" : 10.1,
        "currency" : "USD",
        "text" : "$10.10"
      }
    },
    {
      "description" : "drive to client and back",
      "title" : "item2",
      "qty" : 10,
      "price" : 10
    },
    {
      "description" : "expect 1h labor",
      "title" : "item3",
      "qty" : 1,
      "price" : "100 USD",
      "taxable" : false
    },
    {
      "description" : "expect 2h labor",
      "title" : "item4",
      "qty" : 1,
      "price" : {
        "value" : "100",
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : {
        "name" : "foo",
        "organization_id" : 775,
        "rate_details" : [
          {
            "id" : "1001",
            "name" : "VAT",
            "rate" : 0.05
          },
          {
            "id" : "1002",
            "name" : "n5",
            "rate" : 0.05
          }
        ]
      }
    }
  ],
  "tax_rate" : {
    "name" : "foo",
    "organization_id" : 775,
    "rate_details" : [
      {
        "id" : "1001",
        "name" : "VAT",
        "rate" : 0.025
      },
      {
        "id" : "1002",
        "name" : "n5",
        "rate" : 0.025
      }
    ],
    "extra_field" : "should be ignored"
  },
  "external_ids" : null,
  "extra_field" : "should be ignored"
}
BODY
{
  "organization_id" : 775,
  "job_id" : 425,
  "doc_type" : "Invoice",
  "description" : "Toilet flooding",
  "due_date" : "2016-02-23T16:09:14+00:00",
  "customer" : {
    "customer_id" : 494,
    "first_name" : "John-516",
    "last_name" : "Doe-498",
    "full_name" : "John-516 Doe-498",
    "company_name" : "Company-531",
    "phone_number" : "+15555550525",
    "email" : "customer-522@example.com",
    "address" : {
      "attention_to" : "John-516 Doe-498",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "payee" : {
    "full_name" : "John-518 Doe-500",
    "phone_number" : "+15555550527",
    "company_name" : "Company-533",
    "email" : "customer-524@example.com",
    "address" : {
      "attention_to" : "John-518 Doe-500",
      "street_1" : "123 Summer St",
      "street_2" : "apt 5",
      "city" : "Boston",
      "postal_code" : "02110",
      "state" : "MA",
      "country" : "United States"
    },
    "extra_field" : "should be ignored"
  },
  "discount_amount" : {
    "currency" : "USD",
    "value" : 1,
    "text" : "$0.00"
  },
  "discount_percent" : 0.25,
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-12-31T16:00:00+00:00",
  "issued_at" : "2015-12-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Tiny note",
  "lines" : [
    {
      "billing_item_id" : 1,
      "title" : "item1",
      "taxable" : true,
      "description" : "pipes",
      "qty" : 10,
      "price" : {
        "value" : 10.1,
        "currency" : "USD",
        "text" : "$10.10"
      }
    },
    {
      "description" : "drive to client and back",
      "title" : "item2",
      "qty" : 10,
      "price" : 10
    },
    {
      "description" : "expect 1h labor",
      "title" : "item3",
      "qty" : 1,
      "price" : "100 USD",
      "taxable" : false
    },
    {
      "description" : "expect 2h labor",
      "title" : "item4",
      "qty" : 1,
      "price" : {
        "value" : "100",
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : {
        "name" : "foo",
        "organization_id" : 775,
        "rate_details" : [
          {
            "id" : "1001",
            "name" : "VAT",
            "rate" : 0.05
          },
          {
            "id" : "1002",
            "name" : "n5",
            "rate" : 0.05
          }
        ]
      }
    }
  ],
  "tax_rate" : {
    "name" : "foo",
    "organization_id" : 775,
    "rate_details" : [
      {
        "id" : "1001",
        "name" : "VAT",
        "rate" : 0.025
      },
      {
        "id" : "1002",
        "name" : "n5",
        "rate" : 0.025
      }
    ],
    "extra_field" : "should be ignored"
  },
  "external_ids" : [],
  "extra_field" : "should be ignored"
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

4323

BODY
{
  "billing_document" : {
    "id" : 105,
    "status" : "draft",
    "doc_type" : "Invoice",
    "number" : "160209425",
    "job_id" : 425,
    "organization_id" : 775,
    "title" : null,
    "description" : "Toilet flooding",
    "due_date" : "2016-02-23",
    "discount_amount" : {
      "value" : "1.00",
      "currency" : "USD",
      "text" : "$1.00"
    },
    "discount_percent" : "0.25",
    "paid" : false,
    "subtotal" : {
      "value" : "401.00",
      "currency" : "USD",
      "text" : "$401.00"
    },
    "tax_amount" : {
      "value" : "20.05",
      "currency" : "USD",
      "text" : "$20.05"
    },
    "total" : {
      "value" : "420.05",
      "currency" : "USD",
      "text" : "$420.05"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2016-02-09T16:09:14+0000",
    "updated_at" : "2016-02-09T16:09:14+0000",
    "customer_signature" : null,
    "skip_customer_signature" : false,
    "customer_signed_at" : null,
    "invoice_id" : null,
    "attachment_id" : null,
    "estimated_start_at" : "2016-12-31T16:00:00+0000",
    "issued_at" : "2015-12-31T14:00:00+0000",
    "contract" : "foo",
    "payment_terms" : "bar",
    "job_title" : "Job Title 410",
    "line_item_level_tax" : true,
    "customer_full_name" : null,
    "external_ids" : [],
    "external_number" : "123456",
    "po_number" : "PO#42",
    "apply_tax_after_discount" : true,
    "organization_signature" : "Service Provider signature",
    "skip_organization_signature" : false,
    "organization_signed_at" : null,
    "note" : "Tiny note",
    "address" : null,
    "customer" : {
      "customer_id" : 494,
      "first_name" : "John-516",
      "last_name" : "Doe-498",
      "full_name" : "John-516 Doe-498",
      "company_name" : "Company-531",
      "phone_number" : "+15555550525",
      "email" : "customer-522@example.com",
      "address" : {
        "attention_to" : "John-516 Doe-498",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States"
      }
    },
    "payee" : {
      "full_name" : "John-518 Doe-500",
      "company_name" : "Company-533",
      "phone_number" : "+15555550527",
      "email" : "customer-524@example.com",
      "address" : {
        "attention_to" : "John-518 Doe-500",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States"
      }
    },
    "payer" : {
      "customer_id" : 494,
      "first_name" : "John-516",
      "last_name" : "Doe-498",
      "full_name" : "John-516 Doe-498",
      "company_name" : "Company-531",
      "phone_number" : "+15555550525",
      "email" : "customer-522@example.com",
      "address" : {
        "attention_to" : "John-516 Doe-498",
        "street_1" : "123 Summer St",
        "street_2" : "apt 5",
        "postal_code" : "02110",
        "city" : "Boston",
        "state" : "MA",
        "country" : "United States"
      }
    },
    "tax_rate" : {
      "id" : null,
      "name" : "foo",
      "active" : false,
      "total_rate" : 0.05,
      "rate_details" : [
        {
          "id" : "1001",
          "name" : "VAT",
          "rate" : 0.025,
          "agency" : null
        },
        {
          "id" : "1002",
          "name" : "n5",
          "rate" : 0.025,
          "agency" : null
        }
      ],
      "organization_id" : null,
      "updated_by" : null
    },
    "version" : "v2",
    "updated_by" : "user:18395265-4d18-47da-88c3-6075c91c18c8",
    "payments" : [],
    "lines" : [
      {
        "id" : "3061450b-dd27-4730-bd54-9e40ca356310",
        "appointment_id" : null,
        "title" : "item1",
        "billing_item_id" : 1,
        "qty" : 10.0,
        "description" : "pipes",
        "price" : {
          "value" : "10.10",
          "currency" : "USD",
          "text" : "$10.10"
        },
        "price_with_markup" : {
          "value" : "10.10",
          "currency" : "USD",
          "text" : "$10.10"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : true,
        "total" : {
          "value" : "106.05",
          "currency" : "USD",
          "text" : "$106.05"
        }
      },
      {
        "id" : "bf5d5ee9-ac31-4d65-94c6-b651b21995e4",
        "appointment_id" : null,
        "title" : "item2",
        "billing_item_id" : null,
        "qty" : 10.0,
        "description" : "drive to client and back",
        "price" : {
          "value" : "10.00",
          "currency" : "USD",
          "text" : "$10.00"
        },
        "price_with_markup" : {
          "value" : "10.00",
          "currency" : "USD",
          "text" : "$10.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : null,
        "total" : {
          "value" : "105.00",
          "currency" : "USD",
          "text" : "$105.00"
        }
      },
      {
        "id" : "a84ea30e-b4eb-421a-bae4-30c2930943b5",
        "appointment_id" : null,
        "title" : "item3",
        "billing_item_id" : null,
        "qty" : 1.0,
        "description" : "expect 1h labor",
        "price" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "price_with_markup" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : false,
        "total" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        }
      },
      {
        "id" : "048d6e15-85ea-42bb-aa00-cb2f2cd07d0d",
        "appointment_id" : null,
        "title" : "item4",
        "billing_item_id" : null,
        "qty" : 1.0,
        "description" : "expect 2h labor",
        "price" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "price_with_markup" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "markup" : 0.0,
        "tax" : {
          "id" : null,
          "name" : "foo",
          "active" : false,
          "total_rate" : 0.1,
          "rate_details" : [
            {
              "id" : "1001",
              "name" : "VAT",
              "rate" : 0.05,
              "agency" : null
            },
            {
              "id" : "1002",
              "name" : "n5",
              "rate" : 0.05,
              "agency" : null
            }
          ],
          "organization_id" : null,
          "updated_by" : null
        },
        "taxable" : null,
        "total" : {
          "value" : "110.00",
          "currency" : "USD",
          "text" : "$110.00"
        }
      }
    ]
  }
}

List billing documents

List of Billing Documents for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v2/billing_documents
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2516

BODY
{
  "billing_documents" : [
    {
      "id" : 128,
      "status" : "draft",
      "doc_type" : "Estimate",
      "number" : "160209461",
      "job_id" : 461,
      "organization_id" : 827,
      "title" : null,
      "description" : "Billing 3",
      "discount_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "discount_percent" : null,
      "paid" : false,
      "subtotal" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "tax_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total_paid" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "created_at" : "2016-02-09T16:09:27+0000",
      "updated_at" : "2016-02-09T16:09:27+0000",
      "customer_signature" : null,
      "skip_customer_signature" : false,
      "customer_signed_at" : null,
      "invoice_id" : null,
      "attachment_id" : null,
      "estimated_start_at" : "2016-02-11T16:06:40+0000",
      "issued_at" : null,
      "contract" : null,
      "payment_terms" : null,
      "job_title" : "Job Title 446",
      "line_item_level_tax" : null,
      "customer_full_name" : null,
      "external_ids" : [],
      "external_number" : null,
      "po_number" : null,
      "apply_tax_after_discount" : false,
      "organization_signature" : null,
      "skip_organization_signature" : false,
      "organization_signed_at" : null,
      "note" : null,
      "address" : null,
      "customer" : {},
      "payee" : {
        "full_name" : "foo",
        "company_name" : "bar"
      },
      "payer" : {},
      "tax_rate" : null,
      "version" : "v2",
      "updated_by" : "system",
      "lines" : []
    },
    {
      "id" : 127,
      "status" : "draft",
      "doc_type" : "Invoice",
      "number" : "160209461",
      "job_id" : 461,
      "organization_id" : 827,
      "title" : null,
      "description" : "Billing 2",
      "due_date" : "2016-02-23",
      "discount_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "discount_percent" : null,
      "paid" : false,
      "subtotal" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "tax_amount" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "total_paid" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "created_at" : "2016-02-09T16:09:27+0000",
      "updated_at" : "2016-02-09T16:09:27+0000",
      "customer_signature" : null,
      "skip_customer_signature" : false,
      "customer_signed_at" : null,
      "invoice_id" : null,
      "attachment_id" : null,
      "estimated_start_at" : "2016-02-11T16:06:40+0000",
      "issued_at" : null,
      "contract" : null,
      "payment_terms" : null,
      "job_title" : "Job Title 446",
      "line_item_level_tax" : null,
      "customer_full_name" : null,
      "external_ids" : [],
      "external_number" : null,
      "po_number" : null,
      "apply_tax_after_discount" : false,
      "organization_signature" : null,
      "skip_organization_signature" : false,
      "organization_signed_at" : null,
      "note" : null,
      "address" : null,
      "customer" : {},
      "payee" : {
        "full_name" : "foo",
        "company_name" : "bar"
      },
      "payer" : {},
      "tax_rate" : null,
      "version" : "v2",
      "updated_by" : "system",
      "payments" : [],
      "lines" : []
    }
  ]
}

Remove Billing Document

Removes specified BillingDocument

Request

ROUTE
DELETE /v2/billing_documents/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "123"
}
BODY
{}

Response

Update Estimate

Updates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
customer_signature required Bytes base64 encoded signature of customer.
Required if document is not 'draft' or 'lost' unless skip_customer_signature is set to true
skip_customer_signature optional Boolean If customer chooses not to sign document
status optional String Status of Billing Docment. Default value is draft.
For Estimate valid statuses are: draft, sent, won and lost
For Invoice valid statuses are: draft, sent, paid and balance_outstanding
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
external_number optional String Custom ID
po_number optional String PO Number
estimated_start_on optional Date Estimated Start Date
issued_on optional Date Date Issued
organization_signature optional Bytes Service Provider signature
Required if document is not 'draft' or 'lost' unless skip_organization_signature is set to true
skip_organization_signature optional Boolean If Service Provider signature unnecessary
contract optional Text General Contract
payment_terms optional Text Payment Terms
apply_tax_after_discount optional Boolean Determine tax applying logic
line_item_level_tax optional Boolean Determine line_item tax level
tax_rates optional JSON see /v2/tax_rates. Important! No partial updates allowed.
lines optional Lines should be provided always in full. No partial updates allowed.
lines[][id] required String UUID for line item
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional JSON see /v2/tax_rates
lines[][taxable] optional Boolean Represent ability to be taxed
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed (if id is given)

Request

ROUTE
PATCH /v2/billing_documents/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "description" : "New description",
  "due_date" : "2014-12-31T12:00:00+00:00",
  "customer_signature" : "this is my signature",
  "discount_amount" : {
    "currency" : "USD",
    "value" : 10.22,
    "text" : "$100"
  },
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-10-31T16:00:00+00:00",
  "issued_at" : "2015-10-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Other tiny note",
  "lines" : [
    {
      "id" : "8d7af313-c776-4afb-88ed-99d7a39ad809",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 12.37,
      "description" : "",
      "_destroy" : false,
      "billing_item_id" : 19,
      "price" : {
        "value" : 100,
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : null
    },
    {
      "id" : "b92120b5-8efe-43f7-b227-ad74d62744c2",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 1.5,
      "description" : "",
      "_destroy" : true,
      "price" : 1.0
    },
    {
      "description" : "discount",
      "qty" : 1,
      "price" : -1.0,
      "title" : "item2"
    },
    {
      "description" : "some pipe",
      "qty" : 1.13,
      "price" : "7.77 USD",
      "title" : "item3",
      "taxable" : true,
      "tax" : {
        "name" : "foo",
        "organization_id" : 863,
        "rate_details" : null
      }
    }
  ],
  "tax_rate" : null,
  "external_ids" : null,
  "id" : "186"
}
BODY
{
  "description" : "New description",
  "due_date" : "2014-12-31T12:00:00+00:00",
  "customer_signature" : "this is my signature",
  "discount_amount" : {
    "currency" : "USD",
    "value" : 10.22,
    "text" : "$100"
  },
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-10-31T16:00:00+00:00",
  "issued_at" : "2015-10-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Other tiny note",
  "lines" : [
    {
      "id" : "8d7af313-c776-4afb-88ed-99d7a39ad809",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 12.37,
      "description" : "",
      "_destroy" : false,
      "billing_item_id" : 19,
      "price" : {
        "value" : 100,
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : null
    },
    {
      "id" : "b92120b5-8efe-43f7-b227-ad74d62744c2",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 1.5,
      "description" : "",
      "_destroy" : true,
      "price" : 1.0
    },
    {
      "description" : "discount",
      "qty" : 1,
      "price" : -1.0,
      "title" : "item2"
    },
    {
      "description" : "some pipe",
      "qty" : 1.13,
      "price" : "7.77 USD",
      "title" : "item3",
      "taxable" : true,
      "tax" : {
        "name" : "foo",
        "organization_id" : 863,
        "rate_details" : []
      }
    }
  ],
  "tax_rate" : null,
  "external_ids" : []
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2652

BODY
{
  "billing_document" : {
    "id" : 186,
    "status" : "draft",
    "doc_type" : "Estimate",
    "number" : "141229498",
    "job_id" : 498,
    "organization_id" : 863,
    "title" : null,
    "description" : "New description",
    "discount_amount" : {
      "value" : "10.22",
      "currency" : "USD",
      "text" : "$10.22"
    },
    "discount_percent" : null,
    "paid" : false,
    "subtotal" : {
      "value" : "1244.78",
      "currency" : "USD",
      "text" : "$1,244.78"
    },
    "tax_amount" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "total" : {
      "value" : "1234.56",
      "currency" : "USD",
      "text" : "$1,234.56"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2014-12-29T12:00:00+0000",
    "updated_at" : "2014-12-29T12:00:00+0000",
    "customer_signature" : "this is my signature",
    "skip_customer_signature" : false,
    "customer_signed_at" : "2014-12-29T12:00:00+0000",
    "invoice_id" : null,
    "attachment_id" : null,
    "estimated_start_at" : "2016-10-31T16:00:00+0000",
    "issued_at" : "2015-10-31T14:00:00+0000",
    "contract" : "foo",
    "payment_terms" : "bar",
    "job_title" : "Job Title 483",
    "line_item_level_tax" : true,
    "customer_full_name" : null,
    "external_ids" : [],
    "external_number" : "123456",
    "po_number" : "PO#42",
    "apply_tax_after_discount" : true,
    "organization_signature" : "Service Provider signature",
    "skip_organization_signature" : false,
    "organization_signed_at" : "2014-12-29T12:00:00+0000",
    "note" : "Other tiny note",
    "address" : null,
    "customer" : {},
    "payee" : {
      "full_name" : "foo",
      "company_name" : "bar"
    },
    "payer" : {},
    "tax_rate" : null,
    "version" : "v2",
    "updated_by" : "user:56793085-0e16-4b8a-b63b-6cfbb37fd343",
    "lines" : [
      {
        "id" : "8d7af313-c776-4afb-88ed-99d7a39ad809",
        "appointment_id" : null,
        "title" : "item",
        "billing_item_id" : 19,
        "qty" : 12.37,
        "description" : "",
        "price" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "price_with_markup" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : false,
        "total" : {
          "value" : "1237.00",
          "currency" : "USD",
          "text" : "$1,237.00"
        }
      },
      {
        "id" : "b5fc4596-2229-4ba2-9ca9-52c4c760a0ce",
        "appointment_id" : null,
        "title" : "item2",
        "billing_item_id" : null,
        "qty" : 1.0,
        "description" : "discount",
        "price" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "price_with_markup" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : null,
        "total" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        }
      },
      {
        "id" : "1c1b7b74-12d2-4fa6-9391-004899d69565",
        "appointment_id" : null,
        "title" : "item3",
        "billing_item_id" : null,
        "qty" : 1.13,
        "description" : "some pipe",
        "price" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "price_with_markup" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "markup" : 0.0,
        "tax" : {
          "id" : null,
          "name" : "foo",
          "active" : false,
          "total_rate" : null,
          "rate_details" : [],
          "organization_id" : null,
          "updated_by" : null
        },
        "taxable" : true,
        "total" : {
          "value" : "8.78",
          "currency" : "USD",
          "text" : "$8.78"
        }
      }
    ]
  }
}

Update Invoice

Updates a Billing Document for a given set of parameters.

Parameters

Parameter Required Type Description
description optional Text Free-form description for a billing document
due_date required DateTime Indicates due date for Invoice. Required only for Invoice
ISO-8061 formatted datetime: 2014-12-31T13:20:30+0100
customer_signature required Bytes base64 encoded signature of customer.
Required if document is not 'draft' or 'lost' unless skip_customer_signature is set to true
skip_customer_signature optional Boolean If customer chooses not to sign document
status optional String Status of Billing Docment. Default value is draft.
For Estimate valid statuses are: draft, sent, won and lost
For Invoice valid statuses are: draft, sent, paid and balance_outstanding
discount_amount optional Money The value of discount. If present discount_percent will not apply.
Ex. '10' '10.0 USD' or '$10' will be interpreted as 10 US Dollar.
For a list of all available currencies visit https://goo.gl/KZ8ftm
discount_percent optional Float The value from 0 to 1 that represent discount in percentage.
Not apply if discount_amount present.
external_number optional String Custom ID
po_number optional String PO Number
estimated_start_on optional Date Estimated Start Date
issued_on optional Date Date Issued
organization_signature optional Bytes Service Provider signature
Required if document is not 'draft' or 'lost' unless skip_organization_signature is set to true
skip_organization_signature optional Boolean If Service Provider signature unnecessary
contract optional Text General Contract
payment_terms optional Text Payment Terms
apply_tax_after_discount optional Boolean Determine tax applying logic
line_item_level_tax optional Boolean Determine line_item tax level
tax_rates optional JSON see /v2/tax_rates. Important! No partial updates allowed.
lines optional Lines should be provided always in full. No partial updates allowed.
lines[][id] required String UUID for line item
lines[][price] required Float Price per unit for a given document line
lines[][tax] optional JSON see /v2/tax_rates
lines[][taxable] optional Boolean Represent ability to be taxed
lines[][markup] optional Float Markup % for the line item
lines[][qty] required Float Units quantity for for a given document line
lines[][description] required String Description for for a given document line
lines[][appointment_id] optional Integer Appointment ID indicates which appointment
should be updated for a paid amounts
lines[][_destroy] optional Boolean Indicates that current line should be removed (if id is given)

Request

ROUTE
PATCH /v2/billing_documents/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "description" : "New description",
  "due_date" : "2014-12-31T12:00:00+00:00",
  "customer_signature" : "this is my signature",
  "discount_amount" : {
    "currency" : "USD",
    "value" : 10.22,
    "text" : "$100"
  },
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-10-31T16:00:00+00:00",
  "issued_at" : "2015-10-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Other tiny note",
  "lines" : [
    {
      "id" : "2a3e86ee-2523-4ff9-8791-a0a7927fd1e3",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 12.37,
      "description" : "",
      "_destroy" : false,
      "billing_item_id" : 17,
      "price" : {
        "value" : 100,
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : null
    },
    {
      "id" : "c581194c-a10b-46c6-b435-dacfc5203a50",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 1.5,
      "description" : "",
      "_destroy" : true,
      "price" : 1.0
    },
    {
      "description" : "discount",
      "qty" : 1,
      "price" : -1.0,
      "title" : "item2"
    },
    {
      "description" : "some pipe",
      "qty" : 1.13,
      "price" : "7.77 USD",
      "title" : "item3",
      "taxable" : true,
      "tax" : {
        "name" : "foo",
        "organization_id" : 856,
        "rate_details" : null
      }
    }
  ],
  "tax_rate" : null,
  "external_ids" : null,
  "id" : "179"
}
BODY
{
  "description" : "New description",
  "due_date" : "2014-12-31T12:00:00+00:00",
  "customer_signature" : "this is my signature",
  "discount_amount" : {
    "currency" : "USD",
    "value" : 10.22,
    "text" : "$100"
  },
  "external_number" : "123456",
  "po_number" : "PO#42",
  "estimated_start_at" : "2016-10-31T16:00:00+00:00",
  "issued_at" : "2015-10-31T14:00:00+00:00",
  "organization_signature" : "Service Provider signature",
  "contract" : "foo",
  "payment_terms" : "bar",
  "apply_tax_after_discount" : true,
  "line_item_level_tax" : true,
  "note" : "Other tiny note",
  "lines" : [
    {
      "id" : "2a3e86ee-2523-4ff9-8791-a0a7927fd1e3",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 12.37,
      "description" : "",
      "_destroy" : false,
      "billing_item_id" : 17,
      "price" : {
        "value" : 100,
        "currency" : "USD",
        "text" : "$100"
      },
      "tax" : null
    },
    {
      "id" : "c581194c-a10b-46c6-b435-dacfc5203a50",
      "title" : "item",
      "markup" : 0.0,
      "taxable" : false,
      "qty" : 1.5,
      "description" : "",
      "_destroy" : true,
      "price" : 1.0
    },
    {
      "description" : "discount",
      "qty" : 1,
      "price" : -1.0,
      "title" : "item2"
    },
    {
      "description" : "some pipe",
      "qty" : 1.13,
      "price" : "7.77 USD",
      "title" : "item3",
      "taxable" : true,
      "tax" : {
        "name" : "foo",
        "organization_id" : 856,
        "rate_details" : []
      }
    }
  ],
  "tax_rate" : null,
  "external_ids" : []
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

2689

BODY
{
  "billing_document" : {
    "id" : 179,
    "status" : "draft",
    "doc_type" : "Invoice",
    "number" : "141229491",
    "job_id" : 491,
    "organization_id" : 856,
    "title" : null,
    "description" : "New description",
    "due_date" : "2014-12-31",
    "discount_amount" : {
      "value" : "10.22",
      "currency" : "USD",
      "text" : "$10.22"
    },
    "discount_percent" : null,
    "paid" : false,
    "subtotal" : {
      "value" : "1244.78",
      "currency" : "USD",
      "text" : "$1,244.78"
    },
    "tax_amount" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "total" : {
      "value" : "1234.56",
      "currency" : "USD",
      "text" : "$1,234.56"
    },
    "total_paid" : {
      "value" : "0.00",
      "currency" : "USD",
      "text" : "$0.00"
    },
    "created_at" : "2014-12-29T12:00:00+0000",
    "updated_at" : "2014-12-29T12:00:00+0000",
    "customer_signature" : "this is my signature",
    "skip_customer_signature" : false,
    "customer_signed_at" : "2014-12-29T12:00:00+0000",
    "invoice_id" : null,
    "attachment_id" : null,
    "estimated_start_at" : "2016-10-31T16:00:00+0000",
    "issued_at" : "2015-10-31T14:00:00+0000",
    "contract" : "foo",
    "payment_terms" : "bar",
    "job_title" : "Job Title 476",
    "line_item_level_tax" : true,
    "customer_full_name" : null,
    "external_ids" : [],
    "external_number" : "123456",
    "po_number" : "PO#42",
    "apply_tax_after_discount" : true,
    "organization_signature" : "Service Provider signature",
    "skip_organization_signature" : false,
    "organization_signed_at" : "2014-12-29T12:00:00+0000",
    "note" : "Other tiny note",
    "address" : null,
    "customer" : {},
    "payee" : {
      "full_name" : "foo",
      "company_name" : "bar"
    },
    "payer" : {},
    "tax_rate" : null,
    "version" : "v2",
    "updated_by" : "user:b1734b02-a87a-4e20-a3a0-1c263168fe8c",
    "payments" : [],
    "lines" : [
      {
        "id" : "2a3e86ee-2523-4ff9-8791-a0a7927fd1e3",
        "appointment_id" : null,
        "title" : "item",
        "billing_item_id" : 17,
        "qty" : 12.37,
        "description" : "",
        "price" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "price_with_markup" : {
          "value" : "100.00",
          "currency" : "USD",
          "text" : "$100.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : false,
        "total" : {
          "value" : "1237.00",
          "currency" : "USD",
          "text" : "$1,237.00"
        }
      },
      {
        "id" : "8301e666-531c-4c65-828a-8b8c88a7a0ad",
        "appointment_id" : null,
        "title" : "item2",
        "billing_item_id" : null,
        "qty" : 1.0,
        "description" : "discount",
        "price" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "price_with_markup" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        },
        "markup" : 0.0,
        "tax" : null,
        "taxable" : null,
        "total" : {
          "value" : "-1.00",
          "currency" : "USD",
          "text" : "$-1.00"
        }
      },
      {
        "id" : "1ffc5ea1-3db4-44f6-b6a8-55923ceb03fa",
        "appointment_id" : null,
        "title" : "item3",
        "billing_item_id" : null,
        "qty" : 1.13,
        "description" : "some pipe",
        "price" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "price_with_markup" : {
          "value" : "7.77",
          "currency" : "USD",
          "text" : "$7.77"
        },
        "markup" : 0.0,
        "tax" : {
          "id" : null,
          "name" : "foo",
          "active" : false,
          "total_rate" : null,
          "rate_details" : [],
          "organization_id" : null,
          "updated_by" : null
        },
        "taxable" : true,
        "total" : {
          "value" : "8.78",
          "currency" : "USD",
          "text" : "$8.78"
        }
      }
    ]
  }
}

Billing Items V2

Create item

Creates a Billing Item for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id optional Integer Organization ID
account_id optional Integer Account ID
tax_rate_id optional Integer TaxRate ID
type required String One of "item" or "service"
title required String Title or Name for an Item
sku optional String SKU of an Item
price optional Money Rate or Price per piece. Ex. '10' '10.0 USD' or '$10' will be interpreted
as 10 US Dollar. For a list of all available currencies visit https://goo.gl/KZ8ftm
taxable optional Boolean Represent taxability
description optional String Description of an Item
active optional Boolean Is an item active? Default is true
external_ids optional Array OfStrings List of exernal IDs for an Item

Request

ROUTE
POST /v2/billing_items
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 875,
  "title" : "Spaceship",
  "item_type" : "item",
  "description" : "Big and awesome spaceship",
  "taxable" : true,
  "price" : "10.0 CAD",
  "external_ids" : [
    "demo:10010"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

453

BODY
{
  "billing_item" : {
    "id" : 21,
    "organization_id" : 875,
    "account_id" : null,
    "title" : "Spaceship",
    "item_type" : "item",
    "description" : "Big and awesome spaceship",
    "price" : {
      "value" : "10.00",
      "currency" : "CAD",
      "text" : "$10.00"
    },
    "sku" : null,
    "tax_rate_id" : null,
    "active" : true,
    "external_ids" : [],
    "taxable" : true,
    "deleted_at" : null,
    "created_at" : "2016-02-09T16:09:42+0000",
    "updated_at" : "2016-02-09T16:09:42+0000",
    "version" : "v2",
    "updated_by" : "user:591bf87c-f1f5-4e8e-8502-ab17444a7526"
  }
}

List items

List of Billing Items for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v2/billing_items
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

773

BODY
{
  "billing_items" : [
    {
      "id" : 28,
      "organization_id" : 883,
      "account_id" : null,
      "title" : "Item 2",
      "item_type" : "service",
      "description" : null,
      "price" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "sku" : null,
      "tax_rate_id" : null,
      "active" : true,
      "external_ids" : [],
      "taxable" : null,
      "deleted_at" : null,
      "created_at" : "2016-02-09T16:09:43+0000",
      "updated_at" : "2016-02-09T16:09:43+0000",
      "version" : "v2",
      "updated_by" : "system"
    },
    {
      "id" : 27,
      "organization_id" : 883,
      "account_id" : null,
      "title" : "Item 1",
      "item_type" : "service",
      "description" : null,
      "price" : {
        "value" : "0.00",
        "currency" : "USD",
        "text" : "$0.00"
      },
      "sku" : null,
      "tax_rate_id" : null,
      "active" : true,
      "external_ids" : [],
      "taxable" : null,
      "deleted_at" : null,
      "created_at" : "2016-02-09T16:09:43+0000",
      "updated_at" : "2016-02-09T16:09:43+0000",
      "version" : "v2",
      "updated_by" : "system"
    }
  ]
}

Delete billing item

Deletes a Billing Item

Request

ROUTE
DELETE /v2/billing_items/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "24"
}
BODY
{}

Response

Update an item

Updates a Billing Item for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id optional Integer Organization ID
account_id optional Integer Account ID
tax_rate_id optional Integer TaxRate ID
type required String One of "item" or "service"
title required String Title or Name for an Item
sku optional String SKU of an Item
price optional Float Rate or Price per piece
taxable optional Boolean Represent taxability
description optional String Description of an Item
active optional Boolean Is an item active? Default is true
external_ids optional Array OfStrings List of exernal IDs for an Item

Request

ROUTE
PATCH /v2/billing_items/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "51"
}
BODY
{
  "title" : "New Name",
  "description" : "New Description",
  "price" : "10.0 PLN",
  "taxable" : true,
  "external_ids" : [
    "demo:10010"
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

448

BODY
{
  "billing_item" : {
    "id" : 51,
    "organization_id" : 893,
    "account_id" : null,
    "title" : "New Name",
    "item_type" : "service",
    "description" : "New Description",
    "price" : {
      "value" : "10.00",
      "currency" : "PLN",
      "text" : "10.00 zł"
    },
    "sku" : null,
    "tax_rate_id" : null,
    "active" : true,
    "external_ids" : [],
    "taxable" : true,
    "deleted_at" : null,
    "created_at" : "2016-02-09T16:09:44+0000",
    "updated_at" : "2016-02-09T16:09:44+0000",
    "version" : "v2",
    "updated_by" : "user:5b2c650d-c422-4342-8d2b-6d7f743a9e30"
  }
}

Tax Rates V2

Create Tax Rate

Creates a Tax Rate for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
name required String A name of the tax_rate
active required Boolean Mark as active or not
total_rate required Float A total_rate of entity, a value from 0.0 to 1.0
external_ids optional Array OfStrings List of exernal IDs for an entity
rate_details optional Rate details should be provided always in full.
Important! No partial updates allowed.
rate_details[][id] required String UUID for line item
rate_details[][name] required String A name of RateDetails entity
rate_details[][agency] optional String An agency name
rate_details[][rate] optional Float An amount of tax in percents
rate_details[][_destroy] optional Boolean Indicates that current line should be removed

Request

ROUTE
POST /v2/tax_rates
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

BODY
{
  "organization_id" : 997,
  "name" : "Tax Rate",
  "active" : true,
  "rate_details" : [
    {
      "name" : "Rate Detail",
      "rate" : 0.42
    },
    {
      "name" : "Another Rate Detail",
      "rate" : 0.1,
      "agency" : "An agency"
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

480

BODY
{
  "tax_rate" : {
    "id" : 9,
    "name" : "Tax Rate",
    "active" : true,
    "external_ids" : [],
    "total_rate" : 0.52,
    "rate_details" : [
      {
        "id" : "5ce79ae4-c84a-4b54-ba77-96a8542a8722",
        "name" : "Rate Detail",
        "rate" : 0.42,
        "agency" : null
      },
      {
        "id" : "8a3c636f-1a78-48d0-9b67-beff353d9cac",
        "name" : "Another Rate Detail",
        "rate" : 0.1,
        "agency" : "An agency"
      }
    ],
    "organization_id" : 997,
    "created_at" : "2016-02-09T16:10:00+0000",
    "updated_at" : "2016-02-09T16:10:00+0000",
    "version" : "v2",
    "updated_by" : "user:c2cb8031-5d65-44c5-ae19-6164685ff237"
  }
}

List tax_rates

List of Tax Rates for a given set of filters.

Parameters

Parameter Required Type Description
sort optional String Sorts records for a given order.
Example: sort[]='name asc'
filter optional Array List of filters for a given entity.
See https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching for details on possible predicates
Additional Filters:
- filter[by_group][column]=total_paid_cents Select a column to apply aggregate function
- filter[by_group][aggregate]=sum Sum by column. Possible values are: count, avg, max, min, sum
- filter[by_group][period]=hour Group result by period, possible values are:
second, minute, hour, day, dow, week, month, quarter, year

Request

ROUTE
GET /v2/tax_rates
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

491

BODY
{
  "tax_rates" : [
    {
      "id" : 14,
      "name" : "tax_rate 2",
      "active" : true,
      "external_ids" : [],
      "total_rate" : null,
      "rate_details" : [],
      "organization_id" : 1002,
      "created_at" : "2016-02-09T16:10:00+0000",
      "updated_at" : "2016-02-09T16:10:00+0000",
      "version" : "v2",
      "updated_by" : "system"
    },
    {
      "id" : 13,
      "name" : "tax_rate 1",
      "active" : true,
      "external_ids" : [],
      "total_rate" : null,
      "rate_details" : [],
      "organization_id" : 1002,
      "created_at" : "2016-02-09T16:10:00+0000",
      "updated_at" : "2016-02-09T16:10:00+0000",
      "version" : "v2",
      "updated_by" : "system"
    }
  ]
}

Delete Tax Rate

Deletes a Tax Rate

Request

ROUTE
DELETE /v2/tax_rates/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "10"
}
BODY
{}

Response

Update Tax Rate

Creates a Tax Rate for a given set of parameters.

Parameters

Parameter Required Type Description
organization_id required Integer Organization ID
name required String A name of the tax_rate
active required Boolean Mark as active or not
total_rate required Float A total_rate of entity, a value from 0.0 to 1.0
external_ids optional Array OfStrings List of exernal IDs for an entity
rate_details optional Rate details should be provided always in full.
Important! No partial updates allowed.
rate_details[][id] required String UUID for line item
rate_details[][name] required String A name of RateDetails entity
rate_details[][agency] optional String An agency name
rate_details[][rate] optional Float An amount of tax in percents
rate_details[][_destroy] optional Boolean Indicates that current line should be removed

Request

ROUTE
PATCH /v2/tax_rates/:id
HEADERS
Content-Type

application/json

Accept

application/json

Authorization

Bearer ACCESS_TOKEN

QUERY
{
  "id" : "27"
}
BODY
{
  "name" : "New Name",
  "active" : false,
  "rate_details" : [
    {
      "id" : "23b03917-25c4-4fba-860a-98b13654611c",
      "name" : "A name",
      "rate" : 0.24,
      "agency" : "An agency",
      "_destroy" : false
    },
    {
      "id" : "d1509b23-3d82-4054-baca-7dc7fe520590",
      "name" : "A name",
      "rate" : 0.25,
      "agency" : "An agency",
      "_destroy" : true
    },
    {
      "name" : "Detail",
      "rate" : 0.12,
      "agency" : "hoge"
    }
  ]
}

Response

HEADERS
Content-Type

application/json; charset=utf-8

Content-Length

468

BODY
{
  "tax_rate" : {
    "id" : 27,
    "name" : "New Name",
    "active" : false,
    "external_ids" : [],
    "total_rate" : 0.36,
    "rate_details" : [
      {
        "id" : "23b03917-25c4-4fba-860a-98b13654611c",
        "name" : "A name",
        "rate" : 0.24,
        "agency" : "An agency"
      },
      {
        "id" : "4e4c6cec-6118-4ec2-8521-85116ce8fead",
        "name" : "Detail",
        "rate" : 0.12,
        "agency" : "hoge"
      }
    ],
    "organization_id" : 1010,
    "created_at" : "2016-02-09T16:10:01+0000",
    "updated_at" : "2016-02-09T16:10:01+0000",
    "version" : "v2",
    "updated_by" : "user:19e47a38-ed65-462c-876a-b1d51f4ff510"
  }
}