NAV Navbar
cURL Ruby Python
  • Introduction
  • Authentication
  • Locations
  • Services
  • Wage Tiers
  • Cost Premiums
  • Employees
  • Customers
  • Students
  • Lessons
  • Lesson Participants
  • Other Events
  • Availabilities
  • Unavailabilities
  • Invoices
  • Payments
  • Schemas
  • Introduction

    Welcome to the Teachworks API! This API allows Teachworks users to build custom integrations to interact with data from their Teachworks accounts.

    If you have questions you can contact us at [email protected]

    Request/Response Format

    The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.

    Pagination

    Requests that return multiple items will be paginated to 20 items by default. This default can be changed using the “per_page” parameter up to a maximum of 100 items.

    GET /students?per_page=15

    You can specify further pages with the ?page parameter:

    GET /students?page=2

    Page number is 1-based and omitting the ?page parameter will return the first page.

    Errors

    Occasionally you might encounter errors when accessing the API. There are four possible types:

    Error Code Error Type
    400 Bad Request Invalid request, e.g. using an unsupported HTTP method
    401 Unauthorized Authentication or permission error, e.g. incorrect API token
    403 Forbidden You have likely exceeded the rate limit
    404 Not Found Requests to resources that don't exist or are missing
    500 Internal Sever Error Server error

    Errors return both an appropriate HTTP status code and response object which contains a code, message and data attribute.

    Rate-Limiting

    API calls are currently rate-limited by IP at 90 requests per minute distributed evenly over 1 minute (ie. 1.5 requests per second).

    Authentication

    Teachworks uses API tokens to allow access to the API. You can generate an API token for your Teachworks account by going to the API section on the Integrations & Add-ons page.

    The Teachworks API uses bearer authorization and requires an Authorization header containing you API token to be included in each request. The header should use the following format:

    -H 'Authorization: Token token={api_token}'

    All API requests must be made over HTTPS.

    Calls made over plain HTTP will fail. API requests without authentication will also fail.

    Locations

    Endpoint for viewing locations. Locations are the places where lessons and other events take place.

    Retrieve a location

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/locations/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/locations/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/locations/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/locations/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/locations/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/locations/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/locations/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /locations/{id}

    Retrieves a single location

    JSON response example:

    {
      "id": 3,
      "name": "Room 3",
      "address": "5200 Lakeshore Road",
      "city": "Burlington",
      "state": "Ontario",
      "zip": "L7L 1C5",
      "spaces": "55",
      "calendar_color": "#1449AA",
      "is_sublocation": "1",
      "parent_location_id": "3",
      "link": "http://map.example.com",
      "link_enabled": true,
      "created_at": "2017-05-20T17:48:42Z",
      "updated_at": "2017-08-01T17:48:42Z"
    }
    

    List all locations

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/locations \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/locations HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/locations',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/locations',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/locations',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/locations', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/locations");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /locations

    Returns a list of locations matching the search parameters

    Parameters

    Parameter Description
    namestringfalse search by name
    parent_location_idinteger(int32)false search by parent location id if location is a sub-location
    statestringfalse search by state
    zipstringfalse search by zip
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 3,
        "name": "Room 3",
        "address": "5200 Lakeshore Road",
        "city": "Burlington",
        "state": "Ontario",
        "zip": "L7L 1C5",
        "spaces": "55",
        "calendar_color": "#1449AA",
        "is_sublocation": "1",
        "parent_location_id": "3",
        "link": "http://map.example.com",
        "link_enabled": true,
        "created_at": "2017-05-20T17:48:42Z",
        "updated_at": "2017-08-01T17:48:42Z"
      }
    ]
    

    Services

    Endpoint for viewing services. Services are set when scheudling lessons.

    Retrieve a service

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/services/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/services/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/services/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/services/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/services/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/services/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/services/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /services/{id}

    Retrieve a single service

    JSON response example:

    {
      "id": 2,
      "name": "Math Tutoring",
      "default_cost": "40",
      "default_wage": "25.50",
      "archived": "NULL",
      "created_at": "2017-05-20T17:54:47Z",
      "updated_at": "2017-09-12T17:58:01Z"
    }
    

    List all services

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/services \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/services HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/services',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/services',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/services',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/services', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/services");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /services

    Get a list of all services matching your search parameters

    Parameters

    Parameter Description
    namestringfalse search by service name
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 2,
        "name": "Math Tutoring",
        "default_cost": "40",
        "default_wage": "25.50",
        "archived": "NULL",
        "created_at": "2017-05-20T17:54:47Z",
        "updated_at": "2017-09-12T17:58:01Z"
      }
    ]
    

    Wage Tiers

    Endpoint for viewing and managing wage tiers. Wage tiers can be used to pay teachers at different rates for the same service.

    Retrieve a wage tier

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/wage_tiers/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/wage_tiers/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/wage_tiers/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/wage_tiers/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/wage_tiers/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/wage_tiers/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/wage_tiers/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /wage_tiers/{id}

    Retrieves a single wage tier

    JSON response example:

    {
      "id": 3,
      "name": "Senior Tutor",
      "created_at": "2017-09-22T10:11:59Z",
      "updated_at": "2017-11-22T15:30:59Z"
    }
    

    List all wage tiers

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/wage_tiers \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/wage_tiers HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/wage_tiers',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/wage_tiers',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/wage_tiers',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/wage_tiers', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/wage_tiers");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /wage_tiers

    Returns a list of wage tiers that match the search parameters

    Parameters

    Parameter Description
    namestringfalse search by name
    service_idinteger(int32)false search by the id of the service that this wage tier is associated with
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 3,
        "name": "Senior Tutor",
        "created_at": "2017-09-22T10:11:59Z",
        "updated_at": "2017-11-22T15:30:59Z"
      }
    ]
    

    Cost Premiums

    Endpoint for viewing cost premiums. Cost premiums can be used for adding an additional cost and wage per lesson.

    Retrieve a cost premium

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/cost_premiums/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/cost_premiums/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/cost_premiums/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/cost_premiums/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/cost_premiums/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/cost_premiums/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/cost_premiums/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /cost_premiums/{id}

    Retrieve a single cost premium

    JSON response example:

    {
      "id": 1,
      "name": "25 Miles",
      "amount": "10.50",
      "wage_amount": "5.25",
      "created_at": "2017-04-29T12:00:04Z",
      "updated_at": "2017-09-29T15:08:04Z"
    }
    

    List all cost premiums

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/cost_premiums \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/cost_premiums HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/cost_premiums',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/cost_premiums',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/cost_premiums',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/cost_premiums', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/cost_premiums");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /cost_premiums

    Returns a list of cost premiums that match the search parameters

    Parameters

    Parameter Description
    namestringfalse search by name
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 1,
        "name": "25 Miles",
        "amount": "10.50",
        "wage_amount": "5.25",
        "created_at": "2017-04-29T12:00:04Z",
        "updated_at": "2017-09-29T15:08:04Z"
      }
    ]
    

    Employees

    Endpoint for viewing employees

    Retrieve an employee

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/employees/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/employees/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/employees/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/employees/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/employees/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/employees/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/employees/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /employees/{id}

    Retrieve a single employee

    JSON response example:

    {
      "id": 1,
      "employee_type": "Teacher",
      "include_as_teacher": 0,
      "first_name": "Pamela",
      "last_name": "Johnson",
      "email": "[email protected]",
      "mobile_phone": "123-123-1234",
      "home_phone": "905-399-0079",
      "address": "123 Main Street",
      "address_2": "Apt 1",
      "city": "Beamsville",
      "state": "Ontario",
      "zip": "L0R 1B7",
      "country": "Canada",
      "birth_date": "1988-03-20",
      "hire_date": "2017-02-01",
      "position": "Senior Tutor",
      "additional_notes": "",
      "status": "Active",
      "time_zone": "Eastern Time (US & Canada)",
      "wage_type": "Service List Wage",
      "employee_wage": "25",
      "wage_tier_id": 7,
      "work_wage_type": "Work List Wage",
      "work_wage": "20.50",
      "bio": "Add a bio for the employee here.",
      "bio_drafted_at": "2017-08-08T15:44:29Z",
      "bio_approved": "NULL",
      "bio_approved_at": "2017-09-22T16:18:31Z",
      "email_lesson_reminders": 1,
      "sms_lesson_reminders": 1,
      "subjects": "Math, English",
      "calendar_color": "#834A0B",
      "calendar_color_by": "location",
      "calendar_default_view": "agendaWeek",
      "user_account": 1,
      "unviewed": false,
      "p_employees": "off",
      "p_students": "off",
      "p_services": "view",
      "p_events": "manage",
      "p_event_cost": "off",
      "p_accounting": "off",
      "p_reports": "off",
      "p_settings": "off",
      "p_subscription": "off",
      "p_student_contact": "view",
      "p_events_others": "view",
      "p_events_duration": "manage",
      "p_locations": "view",
      "p_send_notes": "on",
      "p_teachers": "off",
      "p_staff": "off",
      "p_tasks": "off",
      "p_event_wage": "view",
      "p_payroll": "off",
      "p_documents": "on",
      "p_integrations": "off",
      "p_email": "off",
      "created_at": "2017-02-13T17:56:53Z",
      "updated_at": "2017-09-21T15:27:50Z",
      "welcome_sent_at": "2017-02-15T19:30:30Z",
      "custom_fields": [
        {
          "field_id": 12,
          "name": "Orientation completed.",
          "value": "Yes"
        }
      ]
    }
    

    List all employees

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/employees \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/employees HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/employees',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/employees',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/employees',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/employees', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/employees");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /employees

    Returns a list of employees that match the search parameters

    Parameters

    Parameter Description
    first_namestringfalse search by first name
    last_namestringfalse search by last name
    emailstringfalse search by email
    citystringfalse search by city
    statestringfalse search by state
    zipstringfalse search by zip
    statusstringfalse search by status
    subjectstringfalse search by subject
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 1,
        "employee_type": "Teacher",
        "include_as_teacher": 0,
        "first_name": "Pamela",
        "last_name": "Johnson",
        "email": "[email protected]",
        "mobile_phone": "123-123-1234",
        "home_phone": "905-399-0079",
        "address": "123 Main Street",
        "address_2": "Apt 1",
        "city": "Beamsville",
        "state": "Ontario",
        "zip": "L0R 1B7",
        "country": "Canada",
        "birth_date": "1988-03-20",
        "hire_date": "2017-02-01",
        "position": "Senior Tutor",
        "additional_notes": "",
        "status": "Active",
        "time_zone": "Eastern Time (US & Canada)",
        "wage_type": "Service List Wage",
        "employee_wage": "25",
        "wage_tier_id": 7,
        "work_wage_type": "Work List Wage",
        "work_wage": "20.50",
        "bio": "Add a bio for the employee here.",
        "bio_drafted_at": "2017-08-08T15:44:29Z",
        "bio_approved": "NULL",
        "bio_approved_at": "2017-09-22T16:18:31Z",
        "email_lesson_reminders": 1,
        "sms_lesson_reminders": 1,
        "subjects": "Math, English",
        "calendar_color": "#834A0B",
        "calendar_color_by": "location",
        "calendar_default_view": "agendaWeek",
        "user_account": 1,
        "unviewed": false,
        "p_employees": "off",
        "p_students": "off",
        "p_services": "view",
        "p_events": "manage",
        "p_event_cost": "off",
        "p_accounting": "off",
        "p_reports": "off",
        "p_settings": "off",
        "p_subscription": "off",
        "p_student_contact": "view",
        "p_events_others": "view",
        "p_events_duration": "manage",
        "p_locations": "view",
        "p_send_notes": "on",
        "p_teachers": "off",
        "p_staff": "off",
        "p_tasks": "off",
        "p_event_wage": "view",
        "p_payroll": "off",
        "p_documents": "on",
        "p_integrations": "off",
        "p_email": "off",
        "created_at": "2017-02-13T17:56:53Z",
        "updated_at": "2017-09-21T15:27:50Z",
        "welcome_sent_at": "2017-02-15T19:30:30Z",
        "custom_fields": [
        {
          "field_id": 12,
          "name": "Orientation completed.",
          "value": "Yes"
        }
      ]
      }
    ]
    

    Customers

    Endpoint for viewing and managing customers. There are two types of customers in Teachworks: Families & Independent Students.
    Families are customers that have child students and are billed for the fees associated with those students.
    Independent students are students that are billed directly.

    Create a Family

    Example Request:

    
    curl -X POST https://api.teachworks.com/v1/customers/family \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "customer": 
              {			
                "first_name": "Jake & Paula",		
                "last_name": "Jackson",
                "email": "[email protected]",
                "home_phone": "123-123-1234",
                "mobile_phone": "123-123-1234",
                "status": "Active"
               }
           }'
        
      
    

    POST /customers/family

    Use this endpoint to create a family. Families are customers that have child students and are billed for the fees associated with their students.

    Example JSON Response:

    {
      "id": 178,
      "customer_type": "family",
      "salutation": "Mr.",
      "first_name": "Jake & Paula",
      "last_name": "Jackson",
      "email": "[email protected]",
      "additional_email": null,
      "home_phone": "123-123-1234",
      "mobile_phone": "123-123-1234",
      "work_phone": null,
      "address": null,
      "address_2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "additional_notes": null,
      "status": "Active",
      "time_zone": null,
      "email_lesson_reminders": 0,
      "email_lesson_notes": 0,
      "sms_lesson_reminders": 0,
      "user_account": 1,
      "stripe_id": null,
      "unviewed": false,
      "is_family_contact": null,
      "fmaily_customer_id": null,
      "created_at": "2018-04-30T17:57:47Z",
      "updated_at": "2018-04-30T17:57:47Z",
      "welcome_sent_at": null
    }
    

    Arguments

    Argument Description
    idintegerUnique id for customer record
    salutationstringAccepted values: 'Mr.', 'Mrs.', 'Ms.', 'Miss', 'Mr. & Mrs.', 'Dr.'
    first_namestringRequiredFirst name
    last_namestringRequiredLast name
    emailstringPrimary email address used for notifications and user accounts
    additional_emailstringAdditional email addresses. Comma separate for multiple addresses.
    home_phonestringHome phone number
    mobile_phonestringMobile phone number
    work_phonestringWork phone number
    addressstringAddress
    address_2stringAddress line 2
    citystringCity
    statestringState or province
    zipstringZip or postal code
    countrystringCountry
    additional_notesstringAdditional notes about the client
    statusstringActive, Inactive or Prospective
    email_lesson_remindersintegerSet to true to enable email lesson reminders. Email address required if enabled.
    email_lesson_notesintegerSet to true to enable email lesson notes. Email address required if enabled.
    sms_lesson_remindersintegerSet to true to enable SMS lesson reminders. Mobile phone required if enabled.
    stripe_idstringStripe customer ID for payment processing
    unviewedstringSet to true to mark family profile as "New" in Teachworks

    Create an Independent Student

    Example Request:

    
    curl -X POST https://api.teachworks.com/v1/customers/independent_student \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "customer": 
              {			
                "first_name": "Kathy",		
                "last_name": "Milton",
                "status": "Active",
                "email": "[email protected]",
                "mobile_phone": "123-123-1234",
                "students_attributes": [
                  {
                    "start_date": "2018-04-16",
                    "billing_method": "Student Cost",
                    "student_cost": 25.50
                  }
                ]
               }
           }'
        
      
    

    POST /customers/independent_student

    Use this endpoint to create an independent student. Independent students are students that are billed directly.

    Creating an independent student will create a customer record and an associated student record.

    Example JSON Response:

    {
      "id": 178,
      "customer_type": "individual",
      "salutation": null,
      "first_name": "Kathy",
      "last_name": "Milton",
      "email": "[email protected]",
      "additional_email": null,
      "home_phone": null,
      "mobile_phone": "123-123-1234",
      "work_phone": null,
      "address": null,
      "address_2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "additional_notes": null,
      "status": "Active",
      "time_zone": null,
      "email_lesson_reminders": 0,
      "email_lesson_notes": 0,
      "sms_lesson_reminders": 0,
      "user_account": null,
      "stripe_id": null,
      "unviewed": false,
      "created_at": "2018-04-30T17:57:47Z",
      "updated_at": "2018-04-30T17:57:47Z",
      "welcome_sent_at": null
    }
    

    Arguments

    Argument Description
    idintegerUnique id for customer record
    salutationstringAccepted values: 'Mr.', 'Mrs.', 'Ms.', 'Miss', 'Mr. & Mrs.', 'Dr.'
    first_namestringRequiredFirst name
    last_namestringRequiredLast name
    emailstringPrimary email address used for notifications and user accounts
    additional_emailstringAdditional email addresses. Comma separate for multiple addresses.
    home_phonestringHome phone number
    mobile_phonestringMobile phone number
    work_phonestringWork phone number
    addressstringAddress
    address_2stringAddress line 2
    citystringCity
    statestringState or province
    zipstringZip or postal code
    countrystringCountry
    additional_notesstringAdditional notes about the client
    statusstringActive, Inactive or Prospective
    stripe_idstringStripe customer ID for payment processing
    unviewedstringSet to true to mark student profile as "New" in Teachworks
    students_attributesArray with hash of the following:
    » schoolstringStudent's school
    » gradestringStudent's grade level
    » additional_notestextAdditional notes about the student
    » calendar_colorstringHex color code (ie. #800B00) for student's lessons on calendar. Will be set automatically if no value is entered.
    » birth_datedateStudent birth date in YYYY-MM-DD format.
    » start_datedateStudent start date in YYYY-MM-DD format
    » billing_methodstringStudent billing method. Options: 'Service List Cost','Student Cost','Package', 'Flat Fee'
    » student_costdecimalStudent cost per hour (if billing_method set to 'Student Cost')
    » cost_premium_idintegerID of cost premium applied to student lessons
    » discount_rateintegerDiscount rate percentage applied to student lessons (Accepted values: 0 – 100)
    » email_lesson_remindersintegerSet to true to enable email lesson reminders. Email address required if enabled.
    » email_lesson_notesintegerSet to true to enable email lesson notes. Email address required if enabled.
    » sms_lesson_remindersintegerSet to true to enable SMS lesson reminders. Mobile phone required if enabled.
    » default_location_idintegerID of default location for student

    Retrieve a customer

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/customers/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/customers/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/customers/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/customers/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/customers/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/customers/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/customers/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /customers/{id}

    Retrieve a single customer

    JSON response example:

    {
      "id": 1,
      "customer_type": "family",
      "salutation": "Mr.",
      "first_name": "Jeff",
      "last_name": "Jackson",
      "email": "[email protected]",
      "additional_email": "[email protected]",
      "home_phone": "905-399-0379",
      "mobile_phone": "123-123-1234",
      "work_phone": "905-399-0379",
      "address": "4159 Main Street",
      "address_2": "",
      "city": "Burlington",
      "state": "Ontario",
      "zip": "L7L 1C5",
      "country": "Canada",
      "additional_notes": "Notes about customer can go here.",
      "status": "Active",
      "time_zone": "Eastern Time (US & Canada)",
      "email_lesson_reminders": 1,
      "email_lesson_notes": 1,
      "sms_lesson_reminders": 1,
      "last_invoice_date": "2017-12-31",
      "user_account": 1,
      "stripe_id": "cus_79mHvpN8Qee0JJ",
      "unviewed": false,
      "is_family_contact": false,
      "fmaily_customer_id": "7",
      "created_at": "2017-11-29T17:57:47Z",
      "updated_at": "2018-01-01T18:36:44Z",
      "welcome_sent_at": "2017-11-30T09:38:19Z",
      "custom_fields": [
        {
          "field_id": 13,
          "name": "Preferred Method of Contact",
          "value": "Mobile Phone"
        }
      ]
    }
    

    Update a Family

    Example Request:

    
    curl -X PUT https://api.teachworks.com/v1/customers/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "customer": 
              {			
                "first_name": "Jake & Paula",		
                "last_name": "Jackson",
                "email": "[email protected]",
                "home_phone": "123-123-1234",
                "mobile_phone": "123-123-1234",
                "status": "Active"
               }
           }'
        
      
    

    PUT /customers/{id}

    Update an existing family.

    Example JSON Response:

    {
      "id": 178,
      "customer_type": "family",
      "salutation": "Mr.",
      "first_name": "Jake & Paula",
      "last_name": "Jackson",
      "email": "[email protected]",
      "additional_email": null,
      "home_phone": "123-123-1234",
      "mobile_phone": "123-123-1234",
      "work_phone": null,
      "address": null,
      "address_2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "additional_notes": null,
      "status": "Active",
      "time_zone": null,
      "email_lesson_reminders": 0,
      "email_lesson_notes": 0,
      "sms_lesson_reminders": 0,
      "user_account": 1,
      "stripe_id": null,
      "unviewed": true,
      "is_family_contact": false,
      "fmaily_customer_id": null,
      "created_at": "2018-04-30T17:57:47Z",
      "updated_at": "2018-04-30T17:57:47Z",
      "welcome_sent_at": null
    }
    

    Arguments

    Argument Description
    idintegerUnique id for customer record
    salutationstringAccepted values: 'Mr.', 'Mrs.', 'Ms.', 'Miss', 'Mr. & Mrs.', 'Dr.'
    first_namestringRequiredFirst name
    last_namestringRequiredLast name
    emailstringPrimary email address used for notifications and user accounts
    additional_emailstringAdditional email addresses. Comma separate for multiple addresses.
    home_phonestringHome phone number
    mobile_phonestringMobile phone number
    work_phonestringWork phone number
    addressstringAddress
    address_2stringAddress line 2
    citystringCity
    statestringState or province
    zipstringZip or postal code
    countrystringCountry
    additional_notesstringAdditional notes about the client
    statusstringActive, Inactive or Prospective
    email_lesson_remindersintegerSet to true to enable email lesson reminders. Email address required if enabled.
    email_lesson_notesintegerSet to true to enable email lesson notes. Email address required if enabled.
    sms_lesson_remindersintegerSet to true to enable SMS lesson reminders. Mobile phone required if enabled.
    stripe_idstringStripe customer ID for payment processing
    unviewedstringSet to true to mark family profile as "New" in Teachworks

    Update an Independent Student

    Example Request:

    
    curl -X PUT https://api.teachworks.com/v1/customers/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "customer": 
              {			
                "email": "[email protected]",
                "students_attributes": [
                  {
                    "start_date": "2018-04-26"
                  }
                ]
               }
           }'
        
      
    

    PUT /customers/{id}

    Use this endpoint to update an existing an independent student.

    This will update the customer record and associated student record.

    Example JSON Response:

    {
      "id": 178,
      "customer_type": "individual",
      "salutation": null,
      "first_name": "Kathy",
      "last_name": "Milton",
      "email": "[email protected]",
      "additional_email": null,
      "home_phone": null,
      "mobile_phone": "123-123-1234",
      "work_phone": null,
      "address": null,
      "address_2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "additional_notes": null,
      "status": "Active",
      "time_zone": null,
      "email_lesson_reminders": 0,
      "email_lesson_notes": 0,
      "sms_lesson_reminders": 0,
      "user_account": null,
      "stripe_id": null,
      "unviewed": false,
      "created_at": "2018-04-30T17:57:47Z",
      "updated_at": "2018-04-30T17:57:47Z",
      "welcome_sent_at": null
    }
    

    Arguments

    Argument Description
    idintegerUnique id for customer record
    salutationstringAccepted values: 'Mr.', 'Mrs.', 'Ms.', 'Miss', 'Mr. & Mrs.', 'Dr.'
    first_namestringRequiredFirst name
    last_namestringRequiredLast name
    emailstringPrimary email address used for notifications and user accounts
    additional_emailstringAdditional email addresses. Comma separate for multiple addresses.
    home_phonestringHome phone number
    mobile_phonestringMobile phone number
    work_phonestringWork phone number
    addressstringAddress
    address_2stringAddress line 2
    citystringCity
    statestringState or province
    zipstringZip or postal code
    countrystringCountry
    additional_notesstringAdditional notes about the client
    statusstringActive, Inactive or Prospective
    stripe_idstringStripe customer ID for payment processing
    unviewedstringSet to true to mark family profile as "New" in Teachworks
    students_attributesArray with hash of the following:
    » schoolstringStudent's school
    » gradestringStudent's grade level
    » additional_notestextAdditional notes about the student
    » calendar_colorstringHex color code (ie. #800B00) for student's lessons on calendar. Will be set automatically if no value is entered.
    » birth_datedateStudent birth date in YYYY-MM-DD format.
    » start_datedateStudent start date in YYYY-MM-DD format
    » billing_methodstringStudent billing method. Options: 'Service List Cost','Student Cost','Package', 'Flat Fee'
    » student_costdecimalStudent cost per hour (if billing_method set to 'Student Cost')
    » cost_premium_idintegerID of cost premium applied to student lessons
    » discount_rateintegerDiscount rate percentage applied to student lessons (Accepted values: 0 – 100)
    » email_lesson_remindersintegerSet to true to enable email lesson reminders. Email address required if enabled.
    » email_lesson_notesintegerSet to true to enable email lesson notes. Email address required if enabled.
    » sms_lesson_remindersintegerSet to true to enable SMS lesson reminders. Mobile phone required if enabled.
    » default_location_idintegerID of default location for student

    Set Custom Field Values

    
    curl -X PUT https://api.teachworks.com/v1/customers/{id}/custom_fields \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
          "custom_fields":
            [
              {"field_id": 13, "value": "Mobile Phone"},
              {"field_id": 22, "value": "Credit Card"},
              {"field_id": 29, "value": true}
            ]
          }'
        
      
    

    PUT /customers/{id}/custom_fields

    The "Custom Profile Fields" add-on in Teachworks allows companies to create custom fields for all of their customers. When a customer is created, custom field records are auto-generated with empty values. After a customer has been created you can update the custom field values using this endpoint.

    You can get the field_id for each custom field from the student object returned after creating, updating or retrieving a student.

    This endpoint allows you to set the values for up to 10 custom fields at once.

    The JSON response includes an array with any errors for specific records, and an array of updated records.

    You should refer to the settings for this add-on in Teachworks to determine the accepted values for certain custom fields (ie. for select menus, radio buttons, etc.).

    JSON response example:

    {
      "errors": [
        "Custom value with field_id 29 not found."
      ],
      "updated": [
        {
          "field_id": 13,
          "customer_id": 1,
          "name": "Preferred Method of Contact",
          "value": "Mobile Phone"
          "created_at": "2018-03-01T15:32:01Z",
          "updated_at": "2018-03-01T15:32:12Z",
        },
        {
          "field_id": 22,
          "customer_id": 1,
          "name": "Payment Method",
          "value": "Credit Card"
          "created_at": "2018-03-01T15:32:01Z",
          "updated_at": "2018-03-01T15:32:12Z",
        }
      ]
    }
    

    Arguments

    Argument Description
    custom_fieldsarrayRequiredArray containing list of hashes with the following attributes
    » field_idintegerRequiredID of the custom field
    » valuestringRequiredValue for custom field

    List all customers

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/customers \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/customers HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/customers',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/customers',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/customers',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/customers', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/customers");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /customers

    Returns a list of customers that match the search parameters

    Parameters

    Parameter Description
    first_namestringfalse search by first name
    last_namestringfalse search by last name
    emailstringfalse search by email
    citystringfalse search by city
    statestringfalse search by state
    zipstringfalse search by zip
    phone_numberstringfalse search by phone number
    countrystringfalse search by country
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 1,
        "customer_type": "family",
        "salutation": "Mr.",
        "first_name": "Jeff",
        "last_name": "Jackson",
        "email": "[email protected]",
        "additional_email": "[email protected]",
        "home_phone": "905-399-0379",
        "mobile_phone": "123-123-1234",
        "work_phone": "905-399-0379",
        "address": "4159 Main Street",
        "address_2": "",
        "city": "Burlington",
        "state": "Ontario",
        "zip": "L7L 1C5",
        "country": "Canada",
        "additional_notes": "Notes about customer can go here.",
        "status": "Active",
        "time_zone": "Eastern Time (US & Canada)",
        "email_lesson_reminders": 1,
        "email_lesson_notes": 1,
        "sms_lesson_reminders": 1,
        "last_invoice_date": "2017-12-31",
        "user_account": 1,
        "stripe_id": "cus_79mHvpN8Qee0JJ",
        "unviewed": false,
        "is_family_contact": false,
        "fmaily_customer_id": "7",
        "created_at": "2017-11-29T17:57:47Z",
        "updated_at": "2018-01-01T18:36:44Z",
        "welcome_sent_at": "2017-11-30T09:38:19Z"
        "custom_fields": [
        {
          "field_id": 13,
          "name": "Preferred Method of Contact",
          "value": "Mobile Phone"
        }
      ]
      }
    ]
    

    Students

    Endpoint for viewing and managing students. In Teachworks students can be either Child Students or Independent Students. Child students belong to a family and the family is billed for their lesson fees. Independent students are billed directly and can be added throught the Customers endpoint.

    Create a Child Student

    
    curl -X POST https://api.teachworks.com/v1/students \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "student": 
              {			
                "first_name": "Erin",		
                "last_name": "Smith",
                "email": "[email protected]",
                "home_phone",
                "discount_rate": 10,
                "email_lesson_reminders": true,
                "status": "Active"
               }
           }'
        
      
    

    POST /students

    Use this endpoint to create a child student. Child students belong to a family their fees are billed to the family.

    JSON response example:

    {
      "id": 11,
      "customer_id": 10,
      "student_type": "Child",
      "first_name": "Erin",
      "last_name": "Smith",
      "email": "[email protected]",
      "additional_email": "[email protected]",
      "home_phone": null,
      "mobile_phone": "123-123-1234",
      "birth_date": null,
      "start_date": null,
      "school": null,
      "grade": null,
      "additional_notes": ,
      "calendar_color": "#98CFC7",
      "default_location_id": null,
      "status": "Active",
      "time_zone": null,
      "billing_method": "Service List Cost",
      "student_cost": "0",
      "cost_premium_id": null,
      "discount_rate": "10",
      "email_lesson_reminders": 1,
      "email_lesson_notes": 0,
      "sms_lesson_reminders": 0,
      "user_account": 0,
      "unviewed": false,
      "welcome_sent_at": null,
      "created_at": "2018-01-01T15:32:01Z",
      "updated_at": "2018-01-02T15:32:09Z",
      "custom_fields": [
        {
          "field_id": 22,
          "name": "ACT Goal",
          "value": null
        }
      ],
      "default_teachers": [
        {
          "id": 12,
          "first_name": "Marilyn",
          "last_name": Christiansen
        }
      ]
    }
    

    Arguments

    Argument Description
    customer_idintegerRequiredID of customer/family that the student belongs to
    first_namestringRequiredFirst name
    last_namestringRequiredLast name
    emailstringPrimary email address used for notifications and user accounts
    additional_emailstringSecondary email addresses. Comma separate for multiple addresses.
    home_phonestringHome phone number
    mobile_phonestringMobile phone number
    statusstringActive, Inactive or Prospective
    schoolstringStudent billing method. Options: 'Service List Cost','Student Cost','Package', 'Flat Fee'
    gradestringStudent cost per hour (if billing_method set to 'Student Cost')
    additional_notestextID of cost premium applied to student lessons
    calendar_colorstringDiscount rate percentage applied to student lessons (Accepted values: 0 – 100)
    birth_datedateStudent birth date in YYYY-MM-DD format.
    start_datedateStudent start date in YYYY-MM-DD format
    billing_methodstringStudent billing method. Options: 'Service List Cost','Student Cost','Package', 'Flat Fee'
    student_costdecimalStudent cost per hour (if billing_method set to 'Student Cost')
    cost_premium_idintegerID of cost premium applied to student lessons
    discount_ratedecimalDiscount rate percentage applied to student lessons (Accepted values: 0 – 100)
    email_lesson_remindersintegerSet to true to enable email lesson reminders. Email address required if enabled.
    email_lesson_remindersintegerSet to true to enable email lesson notes. Email address required if enabled.
    email_lesson_notesintegerSet to true to enable SMS lesson reminders. Mobile phone required if enabled.
    default_location_idintegerID of default location for student
    unviewedintegerSet to true to mark student profile as "New" in Teachworks

    Create an Independent Student

    Independent Students are added using the following Customers endpoint. Go to endpoint

    POST /customers/independent_student







    Retrieve a student

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/students/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/students/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/students/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/students/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/students/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/students/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/students/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /students/{id}

    Retrieve a single student

    JSON response example:

    {
      "id": 11,
      "customer_id": 10,
      "student_type": "Child",
      "first_name": "Erin",
      "last_name": "Smith",
      "email": "[email protected]",
      "additional_email": "[email protected]",
      "home_phone": "123-123-1234",
      "mobile_phone": "123-123-1234",
      "birth_date": "2014-04-23",
      "start_date": "2018-01-01",
      "school": "John Knox",
      "grade": "Kindergarten",
      "additional_notes": "Additional notes about student",
      "calendar_color": "#98CFC7",
      "default_location_id": 3,
      "status": "Active",
      "time_zone": "Eastern Time (US & Canada)",
      "billing_method": "Package",
      "student_cost": "0",
      "cost_premium_id": 1,
      "discount_rate": "10.25",
      "email_lesson_reminders": 1,
      "email_lesson_notes": 1,
      "sms_lesson_reminders": 1,
      "user_account": 0,
      "unviewed": false,
      "welcome_sent_at": "2018-01-01T15:33:09Z",
      "created_at": "2018-01-01T15:32:01Z",
      "updated_at": "2018-01-02T15:32:09Z",
      "custom_fields": [
        {
          "field_id": 22,
          "name": "ACT Goal",
          "value": "32"
        }
        ],
        "default_teachers": [
          {
            "id": 12,
            "first_name": "Marilyn",
            "last_name": Christiansen
          }
        ]
    }
    

    Update a Child Student

    
    curl -X PUT https://api.teachworks.com/v1/students/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
          "student": 
            {			
              "email_lesson_reminders": false,
              "sms_lesson_reminders": true
             }
           }'
        
      
    

    PUT /students/{id}

    Use this endpoint to update an existing child student.

    JSON response example:

    {
      "id": 11,
      "customer_id": 10,
      "student_type": "Child",
      "first_name": "Erin",
      "last_name": "Smith",
      "email": "[email protected]",
      "additional_email": "[email protected]",
      "home_phone": null,
      "mobile_phone": "123-123-1234",
      "birth_date": null,
      "start_date": null,
      "school": null,
      "grade": null,
      "additional_notes": ,
      "calendar_color": "#98CFC7",
      "default_location_id": null,
      "status": "Active",
      "time_zone": null,
      "billing_method": "Service List Cost",
      "student_cost": "0",
      "cost_premium_id": null,
      "discount_rate": "10",
      "email_lesson_reminders": 0,
      "email_lesson_notes": 0,
      "sms_lesson_reminders": 0,
      "user_account": 1,
      "unviewed": false,
      "welcome_sent_at": null,
      "created_at": "2018-01-01T15:32:01Z",
      "updated_at": "2018-01-02T15:32:09Z",
      "custom_fields": [
        {
          "field_id": 22,
          "name": "ACT Goal",
          "value": null
        }
        ],
        "default_teachers": [
          {
            "id": 12,
            "first_name": "Marilyn",
            "last_name": Christiansen
          }
        ]
    }
    

    Arguments

    Argument Description
    customer_idintegerRequiredID of customer/family that the student belongs to
    first_namestringRequiredFirst name
    last_namestringRequiredLast name
    emailstringPrimary email address used for notifications and user accounts
    additional_emailstringSecondary email addresses. Comma separate for multiple addresses.
    home_phonestringHome phone number
    mobile_phonestringMobile phone number
    statusstringActive, Inactive or Prospective
    schoolstringStudent billing method. Options: 'Service List Cost','Student Cost','Package', 'Flat Fee'
    gradestringStudent cost per hour (if billing_method set to 'Student Cost')
    additional_notestextID of cost premium applied to student lessons
    calendar_colorstringDiscount rate percentage applied to student lessons (Accepted values: 0 – 100)
    birth_datedateStudent birth date in YYYY-MM-DD format.
    start_datedateStudent start date in YYYY-MM-DD format
    billing_methodstringStudent billing method. Options: 'Service List Cost','Student Cost','Package', 'Flat Fee'
    student_costdecimalStudent cost per hour (if billing_method set to 'Student Cost')
    cost_premium_idintegerID of cost premium applied to student lessons
    discount_ratedecimalDiscount rate percentage applied to student lessons (Accepted values: 0 – 100)
    email_lesson_remindersintegerSet to true to enable email lesson reminders. Email address required if enabled.
    email_lesson_remindersintegerSet to true to enable email lesson notes. Email address required if enabled.
    email_lesson_notesintegerSet to true to enable SMS lesson reminders. Mobile phone required if enabled.
    default_location_idintegerID of default location for student
    unviewedintegerSet to true to mark student profile as "New" in Teachworks

    Update an Independent Student

    Independent Students can be updated using the following Customer endpoint. Go to endpoint

    PUT /customers/{id}







    Set Custom Field Values

    
    curl -X PUT https://api.teachworks.com/v1/students/{id}/custom_fields \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
          "custom_fields":
            [
              {"field_id": 22, "value": "Referral"},
              {"field_id": 25, "value": "3.44"},
              {"field_id": 29, "value": true}
            ]
          }'
        
      
    

    PUT /students/{id}/custom_fields

    The "Custom Profile Fields" add-on in Teachworks allows companies to create custom fields for all of their students. When a student is created, custom field records are auto-generated with empty values. After a student has been created you can update the custom field values using this endpoint.

    You can get the field_id for each custom field from the student object returned after creating, updating or retrieving a student.

    This endpoint allows you to set the values for up to 10 custom fields at once.

    The JSON response includes an array with any errors for specific records, and an array of updated records.

    You should refer to the settings for this add-on in Teachworks to determine the accepted values for certain fields (ie. for select menus, radio buttons, etc.).

    JSON response example:

    {
      "errors": [
        "Custom value with field_id 29 not found."
      ],
      "updated": [
        {
          "field_id": 22,
          "student_id": 1,
          "name": "Source",
          "value": "Referral"
          "created_at": "2018-03-01T15:32:01Z",
          "updated_at": "2018-03-01T15:32:12Z",
        },
        {
          "field_id": 25,
          "student_id": 1,
          "name": "GPA",
          "value": "3.44"
          "created_at": "2018-03-01T15:32:01Z",
          "updated_at": "2018-03-01T15:32:12Z",
        }
      ]
    }
    

    Arguments

    Argument Description
    custom_fieldsarrayRequiredArray containing list of hashes with the following attributes
    » field_idintegerRequiredID of the custom field
    » valuestringRequiredValue for custom field

    List all students

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/students \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/students HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/students',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/students',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/students',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/students', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/students");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /students

    Returns a list of students that match the search parameters

    Parameters

    Parameter Description
    customer_idintegerfalse search by customer
    first_namestringfalse search by first name
    last_namestringfalse search by last name
    emailstringfalse search by email
    phone_numberstringfalse search by phone number
    schoolstringfalse search by school
    gradestringfalse search by grade
    subjectstringfalse search by subject
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 11,
        "customer_id": 10,
        "student_type": "Child",
        "first_name": "Erin",
        "last_name": "Smith",
        "email": "[email protected]",
        "additional_email": "[email protected]",
        "home_phone": "123-123-1234",
        "mobile_phone": "123-123-1234",
        "birth_date": "2014-04-23",
        "start_date": "2018-01-01",
        "school": "John Knox",
        "grade": "Kindergarten",
        "additional_notes": "Additional notes about student.",
        "calendar_color": "#98CFC7",
        "default_location_id": 3,
        "status": "Active",
        "time_zone": "Eastern Time (US & Canada)",
        "billing_method": "Package",
        "student_cost": "0",
        "cost_premium_id": 1,
        "discount_rate": "10.25",
        "email_lesson_reminders": 1,
        "email_lesson_notes": 1,
        "sms_lesson_reminders": 1,
        "user_account": 0,
        "unviewed": false,
        "welcome_sent_at": "2018-01-01T15:33:09Z",
        "created_at": "2018-01-01T15:32:01Z",
        "updated_at": "2018-01-02T15:32:09Z",
        "custom_fields": [
        {
          "field_id": 22,
          "name": "ACT Goal",
          "value": "32"
        }
        ],
        "default_teachers": [
          {
            "id": 12,
            "first_name": "Marilyn",
            "last_name": Christiansen
          }
        ]
      }
    ]
    

    Lessons

    Endpoint for viewing lessons

    Retrieve a lesson

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/lessons/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/lessons/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/lessons/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/lessons/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/lessons/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/lessons/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/lessons/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /lessons/{id}

    Retrieve a single lesson

    JSON response example:

    {
      "id": 20,
      "name": "English Lesson",
      "description": "Enter a description for the lesson here.",
      "series_id": 22,
      "location_name": "Downtown Office",
      "location_id": 3,
      "employee_name": "Morrison, Ashley",
      "employee_id": 4,
      "service_name": "Math Tutoring",
      "service_id": 3,
      "spaces": "NULL",
      "joinable": "NULL",
      "from_date": "2018-01-02",
      "from_time": "16:00:00",
      "to_date": "2018-01-02",
      "to_time": "17:00:00",
      "time_zone": "Eastern Time (US & Canada)",
      "from_datetime": "2018-01-02T21:00:00Z",
      "to_datetime": "2018-01-02T22:00:00Z",
      "duration_minutes": 60,
      "status": "Attended",
      "custom_status": "NULL",
      "wage": "25",
      "wage_premium": "0.0",
      "wage_payment_id": 14,
      "cost_override": "NULL",
      "override_method": "NULL",
      "override_value": "NULL",
      "request_comments": "NULL",
      "requested_at": "NULL",
      "request_customer_id": "NULL",
      "request_student_id": "NULL",
      "vehicle_id": "NULL",
      "sms_sent_at": "2018-01-01T16:00:00Z",
      "reminder_sent_at": "2018-01-01T16:00:00Z",
      "cancelled_sent_at": "NULL",
      "completed_at": "NULL",
      "created_at": "2017-12-25T15:55:17Z",
      "updated_at": "2018-01-02T16:00:00Z"
      "participants": [
        {
          "id": 1,
          "lesson_id": 3,
          "student_name": "Anderson, Katie",
          "student_id": 11,
          "description": "Enter a description for the lesson here.",
          "status": "Attended",
          "custom_status": "NULL",
          "unit_price": "40",
          "cost_premium_included": "0.0",
          "discount_rate": "0.0",
          "amount": "40",
          "cost_override_method": "NULL",
          "public_notes": "Shared notes can be entered here.",
          "private_notes": "Notes for internal use can be entered here.",
          "invoice_id": "32",
          "notes_sent_at": "2018-01-08T10:00:03Z",
          "student_reminder_sent_at": "2018-01-06T18:00:00Z",
          "family_reminder_sent_at": "2018-01-06T18:00:00Z",
          "student_sms_sent_at": "2018-01-06T18:00:00Z",
          "family_sms_sent_at": "2018-01-06T18:00:00Z",
          "cancelled_sent_at": "NULL",
          "completed_at": "2018-01-07T18:35:08Z",
          "created_at": "2017-12-24T15:07:20Z",
          "updated_at": "2018-01-07T18:35:08Z"
        }
      ]
    }
    

    List all lessons

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/lessons \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/lessons HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/lessons',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/lessons',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/lessons',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/lessons', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/lessons");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /lessons

    Returns a list of lessons that match the search parameters

    Parameters

    Parameter Description
    namestringfalse search by name
    series_idinteger(int32)false search by series id for repeating lessons
    location_idinteger(int32)false search by location id
    employee_idinteger(int32)false search by employee id
    student_idinteger(int32)false search by student id
    statusstringfalse search by status
    from_datestring(date)false

    search by date the lesson starts on

    Additional Options

    from_date[gt] - search where date is greater than

    from_date[lt] - search where date is less than

    from_date[gte] - search where date is equal to or greater than

    from_date[lte] - search where date is equal to or less than

    to_datestring(date)false search by date the lesson ends on
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 20,
        "name": "English Lesson",
        "description": "Enter a description for the lesson here.",
        "series_id": 22,
        "location_name": "Downtown Office",
        "location_id": 3,
        "employee_name": "Morrison, Ashley",
        "employee_id": 4,
        "service_name": "Math Tutoring",
        "service_id": 3,
        "spaces": "NULL",
        "joinable": "NULL",
        "from_date": "2018-01-02",
        "from_time": "16:00:00",
        "to_date": "2018-01-02",
        "to_time": "17:00:00",
        "time_zone": "Eastern Time (US & Canada)",
        "from_datetime": "2018-01-02T21:00:00Z",
        "to_datetime": "2018-01-02T22:00:00Z",
        "duration_minutes": 60,
        "status": "Attended",
        "custom_status": "NULL",
        "wage": "25",
        "wage_premium": "0.0",
        "wage_payment_id": 14,
        "cost_override": "NULL",
        "override_method": "NULL",
        "override_value": "NULL",
        "request_comments": "NULL",
        "requested_at": "NULL",
        "request_customer_id": "NULL",
        "request_student_id": "NULL",
        "vehicle_id": "NULL",
        "sms_sent_at": "2018-01-01T16:00:00Z",
        "reminder_sent_at": "2018-01-01T16:00:00Z",
        "cancelled_sent_at": "NULL",
        "completed_at": "NULL",
        "created_at": "2017-12-25T15:55:17Z",
        "updated_at": "2018-01-02T16:00:00Z"
        "participants": [
        {
          "id": 1,
          "lesson_id": 3,
          "student_name": "Anderson, Katie",
          "student_id": 11,
          "description": "Enter a description for the lesson here.",
          "status": "Attended",
          "custom_status": "NULL",
          "unit_price": "40",
          "cost_premium_included": "0.0",
          "discount_rate": "0.0",
          "amount": "40",
          "cost_override_method": "NULL",
          "public_notes": "Shared notes can be entered here.",
          "private_notes": "Notes for internal use can be entered here.",
          "invoice_id": "32",
          "notes_sent_at": "2018-01-08T10:00:03Z",
          "student_reminder_sent_at": "2018-01-06T18:00:00Z",
          "family_reminder_sent_at": "2018-01-06T18:00:00Z",
          "student_sms_sent_at": "2018-01-06T18:00:00Z",
          "family_sms_sent_at": "2018-01-06T18:00:00Z",
          "cancelled_sent_at": "NULL",
          "completed_at": "2018-01-07T18:35:08Z",
          "created_at": "2017-12-24T15:07:20Z",
          "updated_at": "2018-01-07T18:35:08Z"
        }
      ]
      }
    ]
    

    Lesson Participants

    Endpoint for viewing lesson participants. Lesson participants are students that are enrolled in a lesson.

    Retrieve a lesson participant

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/lesson_participants/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/lesson_participants/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/lesson_participants/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/lesson_participants/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/lesson_participants/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/lesson_participants/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/lesson_participants/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /lesson_participants/{id}

    Retrieve a single lesson participant

    JSON response example:

    {
      "id": 1,
      "lesson_id": 3,
      "student_name": "Anderson, Katie",
      "student_id": 11,
      "description": "Enter a description for the lesson here.",
      "status": "Attended",
      "custom_status": "NULL",
      "unit_price": "40",
      "cost_premium_included": "0.0",
      "discount_rate": "0.0",
      "amount": "40",
      "cost_override_method": "NULL",
      "public_notes": "Shared notes can be entered here.",
      "private_notes": "Notes for internal use can be entered here.",
      "invoice_id": "32",
      "notes_sent_at": "2018-01-08T10:00:03Z",
      "student_reminder_sent_at": "2018-01-06T18:00:00Z",
      "family_reminder_sent_at": "2018-01-06T18:00:00Z",
      "student_sms_sent_at": "2018-01-06T18:00:00Z",
      "family_sms_sent_at": "2018-01-06T18:00:00Z",
      "cancelled_sent_at": "NULL",
      "completed_at": "2018-01-07T18:35:08Z",
      "created_at": "2017-12-24T15:07:20Z",
      "updated_at": "2018-01-07T18:35:08Z"
    }
    

    List all lesson participants

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/lesson_participants \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/lesson_participants HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/lesson_participants',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/lesson_participants',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/lesson_participants',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/lesson_participants', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/lesson_participants");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /lesson_participants

    Returns a list of lesson participants that match the search parameters

    Parameters

    Parameter Description
    statusstringfalse search by status
    student_idinteger(int32)false search by student id
    lesson_idstringfalse search by lesson id
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 1,
        "lesson_id": 3,
        "student_name": "Anderson, Katie",
        "student_id": 11,
        "description": "Enter a description for the lesson here.",
        "status": "Attended",
        "custom_status": "NULL",
        "unit_price": "40",
        "cost_premium_included": "0.0",
        "discount_rate": "0.0",
        "amount": "40",
        "cost_override_method": "NULL",
        "public_notes": "Shared notes can be entered here.",
        "private_notes": "Notes for internal use can be entered here.",
        "invoice_id": "32",
        "notes_sent_at": "2018-01-08T10:00:03Z",
        "student_reminder_sent_at": "2018-01-06T18:00:00Z",
        "family_reminder_sent_at": "2018-01-06T18:00:00Z",
        "student_sms_sent_at": "2018-01-06T18:00:00Z",
        "family_sms_sent_at": "2018-01-06T18:00:00Z",
        "cancelled_sent_at": "NULL",
        "completed_at": "2018-01-07T18:35:08Z",
        "created_at": "2017-12-24T15:07:20Z",
        "updated_at": "2018-01-07T18:35:08Z"
      }
    ]
    

    Other Events

    Endpoint for viewing other events. Other events can be general events or events that track an employee's non-teaching hours.

    Retrieve an other event

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/other_events/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/other_events/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/other_events/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/other_events/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/other_events/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/other_events/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/other_events/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /other_events/{id}

    Retrieve a single other event

    JSON response example:

    {
      "id": 16,
      "name": "Admin Duties",
      "description": "",
      "audience": "Everyone",
      "series_id": 6,
      "location_id": 2,
      "job_id": 3,
      "from_date": "2018-01-10",
      "from_time": "12:00:00",
      "to_date": "2018-01-10",
      "to_time": "14:00:00",
      "time_zone": "Eastern Time (US & Canada)",
      "from_datetime": "2018-01-10T17:00:00Z",
      "to_datetime": "2018-01-10T19:00:00Z",
      "duration_minutes": 120,
      "is_all_day": false,
      "created_at": "2018-01-09T15:57:45Z",
      "updated_at": "2018-01-10T15:37:24Z"
    }
    

    List all other events

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/other_events \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/other_events HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/other_events',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/other_events',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/other_events',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/other_events', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/other_events");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /other_events

    Returns a list of other events that match the search parameters

    Parameters

    Parameter Description
    from_datestring(date)false

    search by date that event starts on

    Additional Options

    from_date[gt] - search where date is greater than

    from_date[lt] - search where date is less than

    from_date[gte] - search where date is equal to or greater than

    from_date[lte] - search where date is equal to or less than

    to_datestring(date)false search by date the event ends on
    series_idinteger(int32)false search by series id for repeating events
    location_idinteger(int32)false search by location id
    employee_idstringfalse search by employee id
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 16,
        "name": "Admin Duties",
        "description": "",
        "audience": "Everyone",
        "series_id": 6,
        "location_id": 2,
        "job_id": 3,
        "from_date": "2018-01-10",
        "from_time": "12:00:00",
        "to_date": "2018-01-10",
        "to_time": "14:00:00",
        "time_zone": "Eastern Time (US & Canada)",
        "from_datetime": "2018-01-10T17:00:00Z",
        "to_datetime": "2018-01-10T19:00:00Z",
        "duration_minutes": 120,
        "is_all_day": false,
        "created_at": "2018-01-09T15:57:45Z",
        "updated_at": "2018-01-10T15:37:24Z"
      }
    ]
    

    Availabilities

    Endpoint for viewing availabilities. Availabilities are the days of the week and times that teachers are available.

    Retreive an availability

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/availabilities/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/availabilities/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/availabilities/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/availabilities/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/availabilities/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/availabilities/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/availabilities/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /availabilities/{id}

    Retrieve a single availability

    JSON response example:

    {
      "id": 1,
      "employee_id": 11,
      "day": "5",
      "start_time": "17:00:00",
      "end_time": "20:00:00",
      "description": "Add notes here.",
      "created_at": "2017-07-21T15:49:09Z",
      "updated_at": "2017-09-08T17:58:14Z"
    }
    

    List all availabilities

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/availabilities \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/availabilities HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/availabilities',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/availabilities',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/availabilities',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/availabilities', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/availabilities");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /availabilities

    Returns a list of availabilities that match the search parameters

    Parameters

    Parameter Description
    employee_idinteger(int32)false search by employee id
    daystringfalse search by day
    start_timestringfalse search by start time
    end_timestringfalse search by end time
    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 1,
        "employee_id": 11,
        "day": "5",
        "start_time": "17:00:00",
        "end_time": "20:00:00",
        "description": "Add notes here.",
        "created_at": "2017-07-21T15:49:09Z",
        "updated_at": "2017-09-08T17:58:14Z"
      }
    ]
    

    Unavailabilities

    Endpoint for viewing unavailabilities. Unavailabilties are specific dates and times that an employee is unavailable.

    Retrieve an unavailability

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/unavailabilities/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/unavailabilities/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/unavailabilities/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/unavailabilities/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/unavailabilities/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/unavailabilities/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/unavailabilities/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /unavailabilities/{id}

    Retrieves a single unavailability

    JSON response example:

    {
      "id": 59,
      "series_id": 38,
      "employee_id": 3,
      "description": "Personal Leave",
      "from_date": "2018-01-01",
      "from_time": "15:00:00",
      "to_date": "2018-01-03",
      "to_time": "15:00:00",
      "time_zone": "Eastern Time (US & Canada)",
      "from_datetime": "2018-01-01T20:00:00Z",
      "to_datetime": "2018-01-03T20:00:00Z",
      "created_at": "2017-12-31T23:09:24Z",
      "updated_at": "2018-01-01T15:29:59Z"
    }
    

    List all unavailabilities

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/unavailabilities \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/unavailabilities HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/unavailabilities',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/unavailabilities',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/unavailabilities',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/unavailabilities', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/unavailabilities");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /unavailabilities

    Returns a list of unavailabilities that match the search parameters

    Parameters

    Parameter Description
    employee_idinteger(int32)false search by employee id
    series_idinteger(int32)false search by series id for repeating unavailabilities
    from_datestring(date)false

    search by date the unavailability starts on

    Additional Options

    from_date[gt] - search where date is greater than

    from_date[lt] - search where date is less than

    from_date[gte] - search where date is equal to or greater than

    from_date[lte] - search where date is equal to or less than

    to_datestring(date)false

    search by date the unavailability ends on

    Additional Options

    to_date[gt] - search where date is greater than

    to_date[lt] - search where date is less than

    to_date[gte] - search where date is equal to or greater than

    to_date[lte] - search where date is equal to or less than

    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
        "id": 59,
        "series_id": 38,
        "employee_id": 3,
        "description": "Personal Leave",
        "from_date": "2018-01-01",
        "from_time": "15:00:00",
        "to_date": "2018-01-03",
        "to_time": "15:00:00",
        "time_zone": "Eastern Time (US & Canada)",
        "from_datetime": "2018-01-01T20:00:00Z",
        "to_datetime": "2018-01-03T20:00:00Z",
        "created_at": "2017-12-31T23:09:24Z",
        "updated_at": "2018-01-01T15:29:59Z"
      }
    ]
    

    Invoices

    Endpoint for viewing customer invoices and credit notes

    Retrieve an Invoice

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/invoices/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/invoices/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/invoices/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/invoices/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/invoices/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/invoices/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/invoices/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /invoices/{id}

    Retrieves a single invoice

    JSON response example:

    {
      "id": 259,
      "customer_id": 13,
      "invoice_type": "invoice",
      "number": 216,
      "date": "2018-07-01",
      "due_date": "2018-07-31",
      "reference": ,
      "tax_treatment": "Tax Exclusive",
      "status": "Approved",
      "start_date": "2018-07-01",
      "end_date": "2018-07-31",
      "lesson_status": "Scheduled",
      "terms_text": "Please pay online by the due date listed.",
      "subtotal": "55.25",
      "sales_tax_total": "0.00",
      "total": "55.25",
      "hide_flags": false,
      "sent_at": "2018-07-01T23:09:24Z",
      "reminder_sent_at": "2018-07-31T23:09:24Z",
      "created_at": "2018-07-17T23:09:24Z",
      "updated_at": "2018-07-17T23:09:24Z",
      "lessons": [
        {
          "id": 262,
          "student_id": 12,
          "description": "Katie Anderson - Scheduled 2018-07-10 01:00 PM - 02:00 PM",
          "status": Scheduled,
          "custom_status": null,
          "invoice_unit_price": "40.00",
          "invoice_discount_rate": "10.00",
          "invoice_amount": "36.00",
          "created_at": "2018-07-17T23:19:24Z",
          "updated_at": "2018-07-17T23:19:24Z"
          },
      ],
      "charges": [
        {
          "id": 262,
            "title": "Charge",
            "description": "Initial Consultation & Placement Test",
            "quantity": "1.00",
            "unit_price": "35.00",
            "discount_rate": "0.00",
            "amount": "35.00",
            "created_at": "2018-07-17T23:19:24Z",
            "updated_at": "2018-07-17T23:19:24Z"
          }
      ],
      "packages": [
        {
          "id": 123,
          "student_id": 123,
          "service_id": 123,
          "description": "10 Hour Package of French Tutoring",
          "quantity": "10.00",
          "unit_price": "40.00",
          "discount_rate": "0.00",
          "amount": "400.00",
          "created_at": "2018-07-17T23:19:24Z",
          "updated_at": "2018-07-17T23:19:24Z"
        }
      ]
    }
    

    List all invoices

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/invoices \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/invoices HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/invoices',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/invoices',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/invoices',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/invoices', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/invoices");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /invoices

    Returns a list of invoices that match the search parameters

    Parameters

    Parameter Description
    customer_idinteger(int32)false search by customer id
    numberinteger(int32)false search by invoice number
    statusstringfalse search by invoice status
    datestring(date)false

    search by invoice date

    Additional Options

    date[gt] - search where date is greater than

    date[lt] - search where date is less than

    date[gte] - search where date is equal to or greater than

    date[lte] - search where date is equal to or less than

    due_datestring(date)false

    search by invoice due date

    Additional Options

    due_date[gt] - search where date is greater than

    ddue_ate[lt] - search where date is less than

    due_date[gte] - search where date is equal to or greater than

    due_date[lte] - search where date is equal to or less than

    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    {
          "id": 259,
          "customer_id": 13,
          "invoice_type": "invoice",
          "number": 216,
          "date": "2018-07-01",
          "due_date": "2018-07-31",
          "reference": ,
          "tax_treatment": "Tax Exclusive",
          "status": "Approved",
          "start_date": "2018-07-01",
          "end_date": "2018-07-31",
          "lesson_status": "Scheduled",
          "terms_text": "Please pay online by the due date listed.",
          "subtotal": "55.25",
          "sales_tax_total": "0.00",
          "total": "55.25",
          "hide_flags": false,
          "sent_at": "2018-07-01T23:09:24Z",
          "reminder_sent_at": "2018-07-31T23:09:24Z",
          "created_at": "2018-07-17T23:09:24Z",
          "updated_at": "2018-07-17T23:09:24Z",
          "lessons": [
            {
              "id": 262,
              "student_id": 12,
              "description": "Katie Anderson - Scheduled 2018-07-10 01:00 PM - 02:00 PM",
              "status": Scheduled,
              "custom_status": null,
              "invoice_unit_price": "40.00",
              "invoice_discount_rate": "10.00",
              "invoice_amount": "36.00",
              "created_at": "2018-07-17T23:19:24Z",
              "updated_at": "2018-07-17T23:19:24Z"
              },
          ],
          "charges": [
            {
              "id": 262,
                "title": "Charge",
                "description": "Initial Consultation & Placement Test",
                "quantity": "1.00",
                "unit_price": "35.00",
                "discount_rate": "0.00",
                "amount": "35.00",
                "created_at": "2018-07-17T23:19:24Z",
                "updated_at": "2018-07-17T23:19:24Z"
              }
          ],
          "packages": [
            {
              "id": 123,
              "student_id": 123,
              "service_id": 123,
              "description": "10 Hour Package of French Tutoring",
              "quantity": "10.00",
              "unit_price": "40.00",
              "discount_rate": "0.00",
              "amount": "400.00",
              "created_at": "2018-07-17T23:19:24Z",
              "updated_at": "2018-07-17T23:19:24Z"
            }
          ]
        }
        

    Payments

    Endpoint for viewing customer payments and refunds

    Create a Payment

    
    curl -X POST https://api.teachworks.com/v1/payments \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "payment": 
              {			
                "customer_id": 13,		
                "date": "2018-07-17",
                "amount": "55.25",
                "description": "Payment for INV-0216",
                "payment_method": "Cash"
               }
           }'
        
      
    

    POST /payments

    Use this endpoint to create a payment.

    Example JSON Response:

    {
      "id": 259,
      "customer_id": 13,
      "date": "2018-07-17",
      "amount": 55.25,
      "description": Payment for INV-0216,
      "payment_method": Cash,
      "type": payment,
      "stripe_transaction_id": null,
      "sent_at": "2018-07-17T23:09:24Z",
      "created_at": "2018-07-17T23:09:24Z",
      "updated_at": "2018-07-17T23:09:24Z",
      "refunds": [],
      "payment_allocations": []
    }
    

    Arguments

    Argument Description
    customer_idstringID of customer that made the payment
    datestringRequiredDate
    amountstringRequiredAmount
    descriptionstringDetails or description of payment
    payment_methodstringMethod of payment. Valid options are Cash, Check, Credit Card, Debit Card, Bank Transfer, PayPal, Other
    stripe_transaction_idstringTransaction ID if processed through Stripe

    Retrieve a Payment

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/payments/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/payments/{id} HTTP/1.1
    Host: api.teachworks.com
    
    
    Content-Type: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/payments/{id}',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/payments/{id}',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/payments/{id}',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/payments/{id}', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/payments/{id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /payments/{id}

    Retrieves a single payment

    JSON response example:

    {
      "id": 259,
      "customer_id": 13,
      "date": "2018-07-17",
      "amount": 55.25,
      "description": Payment for INV-0216,
      "payment_method": Cash,
      "type": payment,
      "stripe_transaction_id": null,
      "sent_at": "2018-07-17T23:09:24Z",
      "created_at": "2018-07-17T23:09:24Z",
      "updated_at": "2018-07-17T23:09:24Z",
      "refunds": [
        {
          "id": 262,
          "date": "2018-07-17",
          "amount": 10.00,
          "invoice_id": 2193,
          "created_at": "2018-07-17T23:19:24Z",
          "updated_at": "2018-07-17T23:19:24Z"
          },
      ],
      "payment_allocations": [
        {
          "id": 123,
          "date": "2018-07-17",
          "amount": 55.25,
          "invoice_id": 2193,
          "created_at": "2018-07-17T23:19:24Z",
          "updated_at": "2018-07-17T23:19:24Z"
          }
      ]
    }
    

    Update a Payment

    
    curl -X PUT https://api.teachworks.com/v1/payments/{id} \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}' \
      -d '{
            "payment": 
              {			
                "customer_id": 136,		
                "date": "2018-07-18",
                "amount": "250.00",
                "description": "Payment for INV-0307",
                "payment_method": "Credit Card"
               }
           }'
        
      
    

    PUT /payments/{id}

    Update an existing payment. Note: Payments can only be updated if they have not already been allocated or refunded.

    Example JSON Response:

    {
      "id": 559,
      "customer_id": 136,
      "date": "2018-07-18",
      "amount": 250.00,
      "description": Payment for INV-0307,
      "payment_method": Credit Card,
      "type": payment,
      "stripe_transaction_id": null,
      "sent_at": "2018-07-18T23:09:24Z",
      "created_at": "2018-07-18T23:09:24Z",
      "updated_at": "2018-07-18T23:09:24Z",
      "refunds": [],
      "payment_allocations": []
    }
    

    Arguments

    Argument Description
    idintegerUnique id for payment record
    customer_idstringID of customer that made the payment
    datestringRequiredDate
    amountstringRequiredAmount
    descriptionstringDetails or description of payment
    payment_methodstringMethod of payment. Valid options are Cash, Check, Credit Card, Debit Card, Bank Transfer, PayPal, Other
    stripe_transaction_idstringTransaction ID if processed through Stripe

    List all payments

    # You can also use wget
    curl -X GET https://api.teachworks.com/v1/payments \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token token={access_token}'
    
    
    
    GET https://api.teachworks.com/v1/payments HTTP/1.1
    Host: api.teachworks.com
    
    
    Accept: application/json
    
    
    
    var headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    $.ajax({
      url: 'https://api.teachworks.com/v1/payments',
      method: 'get',
    
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    
    const request = require('node-fetch');
    
    
    const headers = {
      'Accept':'application/json',
      'Authorization':'Token token={access_token}'
    
    
    };
    
    
    fetch('https://api.teachworks.com/v1/payments',
    {
      method: 'GET',
    
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    
    require 'rest-client'
    require 'json'
    
    
    headers = {
      'Accept' => 'application/json',
      'Authorization' => 'Token token={access_token}'
    }
    
    
    result = RestClient.get 'https://api.teachworks.com/v1/payments',
      params: {
      }, headers: headers
    
    
    p JSON.parse(result)
    
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'Authorization': 'Token token={access_token}'
    }
    
    
    r = requests.get('https://api.teachworks.com/v1/payments', params={
    
    
    }, headers = headers)
    
    
    print r.json()
    
    
    
    URL obj = new URL("https://api.teachworks.com/v1/payments");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    

    GET /payments

    Returns a list of payments that match the search parameters

    Parameters

    Parameter Description
    customer_idinteger(int32)false search by customer id
    datestring(date)false

    search by date of payment

    Additional Options

    date[gt] - search where date is greater than

    date[lt] - search where date is less than

    date[gte] - search where date is equal to or greater than

    date[lte] - search where date is equal to or less than

    pageinteger(int32)false pass an optional page number for pagination, defaults to page 1
    per_pageinteger(int32)false number of records to display per each page, defaults to 20, maximum 50

    JSON response example:

    [
      {
      "id": 259,
      "customer_id": 13,
      "date": "2018-07-17",
      "amount": 55.25,
      "description": Payment for INV-0216,
      "payment_method": Cash,
      "type": payment,
      "stripe_transaction_id": null,
      "sent_at": "2018-07-17T23:09:24Z",
      "created_at": "2018-07-17T23:09:24Z",
      "updated_at": "2018-07-17T23:09:24Z",
      "refunds": [],
      "payment_allocations": []
      }
    ]
    

    Schemas

    Location

    {
      "id": 3,
      "name": "Room 3",
      "address": "5200 Lakeshore Road",
      "city": "Burlington",
      "state": "Ontario",
      "zip": "L7L 1C5",
      "spaces": "55",
      "calendar_color": "#1449AA",
      "is_sublocation": "1",
      "parent_location_id": "3",
      "link": "http://map.example.com",
      "link_enabled": true,
      "created_at": "2017-05-20T17:48:42Z",
      "updated_at": "2017-08-01T17:48:42Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    namestringfalse Name of location.
    addressstringfalse Physical address of location.
    citystringfalse City of location.
    statestringfalse State of location.
    zipstringfalse A zip or postal code.
    spacesstringfalse The number of spaces available at location.
    calendar_colorstringfalse Calendar color assigned to location.
    is_sublocationstringfalse Whether or not location is a sub-location.
    parent_location_idstringfalse Unique identifier for parent location.
    linkstringfalse Link to map, whiteboard or online meeting room if using Location Links Add-On.
    link_enabledbooleanfalse Enable/disable option to display location name as clickable link if using Location Links Add-On.
    created_atstring(date-time)false When the location was created.
    updated_atstring(date-time)false When the location was last updated.

    Service

    {
      "id": 2,
      "name": "Math Tutoring",
      "default_cost": "40",
      "default_wage": "25.50",
      "archived": "NULL",
      "created_at": "2017-05-20T17:54:47Z",
      "updated_at": "2017-09-12T17:58:01Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for the record.
    namestringfalse Name of service.
    default_coststringfalse Default lesson cost assigned to service.
    default_wagestringfalse Default wage assigned to service.
    archivedstringfalse Whether or not the service is archived.
    created_atstring(date-time)false When service was created.
    updated_atstring(date-time)false When service was last updated.

    WageTier

    {
      "id": 3,
      "name": "Senior Tutor",
      "created_at": "2017-09-22T10:11:59Z",
      "updated_at": "2017-11-22T15:30:59Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    namestringfalse Name of wage tier.
    created_atstring(date-time)false When wage tier was created.
    updated_atstring(date-time)false When wage tier was last updated.

    CostPremium

    {
      "id": 1,
      "name": "25 Miles",
      "amount": "10.50",
      "wage_amount": "5.25",
      "created_at": "2017-04-29T12:00:04Z",
      "updated_at": "2017-09-29T15:08:04Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    namestringfalse The name of the premium.
    amountstringfalse The amount per lesson to charge.
    wage_amountstringfalse The wage premium amount if charging wage premium.
    created_atstring(date-time)false When the premium was created.
    updated_atstring(date-time)false When the premium was last updated.

    Employee

    {
      "id": 1,
      "employee_type": "Teacher",
      "include_as_teacher": 0,
      "first_name": "Pamela",
      "last_name": "Johnson",
      "email": "[email protected]",
      "mobile_phone": "123-123-1234",
      "home_phone": "905-399-0079",
      "address": "123 Main Street",
      "address_2": "Apt 1",
      "city": "Beamsville",
      "state": "Ontario",
      "zip": "L0R 1B7",
      "country": "Canada",
      "birth_date": "1988-03-20",
      "hire_date": "2017-02-01",
      "position": "Senior Tutor",
      "additional_notes": "",
      "status": "Active",
      "time_zone": "Eastern Time (US & Canada)",
      "wage_type": "Service List Wage",
      "employee_wage": "25",
      "wage_tier_id": 7,
      "work_wage_type": "Work List Wage",
      "work_wage": "20.50",
      "bio": "Add a bio for the employee here.",
      "bio_drafted_at": "2017-08-08T15:44:29Z",
      "bio_approved": "NULL",
      "bio_approved_at": "2017-09-22T16:18:31Z",
      "email_lesson_reminders": 1,
      "sms_lesson_reminders": 1,
      "subjects": "Math, English",
      "calendar_color": "#834A0B",
      "calendar_color_by": "location",
      "calendar_default_view": "agendaWeek",
      "user_account": 1,
      "unviewed": false,
      "p_employees": "off",
      "p_students": "off",
      "p_services": "view",
      "p_events": "manage",
      "p_event_cost": "off",
      "p_accounting": "off",
      "p_reports": "off",
      "p_settings": "off",
      "p_subscription": "off",
      "p_student_contact": "view",
      "p_events_others": "view",
      "p_events_duration": "manage",
      "p_locations": "view",
      "p_send_notes": "on",
      "p_teachers": "off",
      "p_staff": "off",
      "p_tasks": "off",
      "p_event_wage": "view",
      "p_payroll": "off",
      "p_documents": "on",
      "p_integrations": "off",
      "p_email": "off",
      "created_at": "2017-02-13T17:56:53Z",
      "updated_at": "2017-09-21T15:27:50Z",
      "welcome_sent_at": "2017-02-15T19:30:30Z",
      "custom_fields": [
        {
          "field_id": 12,
          "name": "Orientation completed.",
          "value": "Yes"
        }
      ]
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for the record.
    employee_typestringfalse The type of employee profile. Can be Staff or Teacher.
    include_as_teacherinteger(int32)false Include Staff employee as teacher.
    first_namestringfalse Employee's firt name.
    last_namestringfalse Employee's last name.
    emailstringfalse Employee's email address.
    mobile_phonestringfalse Employee's mobile number. If sending SMS, use E.164 format.
    home_phonestringfalse Employee's home number.
    addressstringfalse Address line 1.
    address_2stringfalse Address line 2.
    citystringfalse Employee's city of residence.
    statestringfalse Employee's state of residence.
    zipstringfalse Zip or postal code.
    countrystringfalse Employee's country of residence.
    birth_datestring(date)false Employee's date of birth YYYY-MM-DD.
    hire_datestring(date)false Employee's hire date YYYY-MM-DD.
    positionstringfalse Employee's position.
    additional_notesstringfalse Additional notes related to employee.
    statusstringfalse Status of employee profile. Can be "Active", "Inactive" or "Prospective".
    time_zonestringfalse Employee's time zone.
    wage_typestringfalse Wage type used to calculate lesson wages. Can be set to "Service List Wage" to use the wage specified in the service list or "Employee Wage" if setting a wage on the employee's profile.
    employee_wagestringfalse Employee's hourly wage.
    wage_tier_idstringfalse Unique identifier for employee's wage tier.
    work_wage_typestringfalse Wage type used to calculate wage for non-teaching events. Can be set to "Work List Wage" to use the wage specified in the work list, or "Employee Wage" if setting a wage on the employee’s profile.
    work_wagestringfalse Wage for non-teaching events.
    biostringfalse Employee's bio.
    bio_drafted_atstring(date-time)false Last time bio was edited.
    bio_approvedstringfalse No description
    bio_approved_atstring(date-time)false Last time bio was approved.
    email_lesson_remindersinteger(int32)false Enable or disable email lesson reminders.
    sms_lesson_remindersinteger(int32)false Enable or disable SMS lesson reminders.
    subjectsstringfalse Employee's subjects.
    calendar_colorstringfalse Employee's default calendar color.
    calendar_color_bystringfalse Method for displaying calendar colors in Employee's account. Can be by "location", "teacher" or "student".
    calendar_default_viewstringfalse Employee's default calendar view.
    user_accountinteger(int32)false Enable or disable user access.
    unviewedbooleanfalse Indicates if profile is marked as "New" in Teachworks
    p_employeesstringfalse Permission to manage employees.
    p_studentsstringfalse Permission to manage students.
    p_servicesstringfalse Permission to manage service list.
    p_eventsstringfalse Permission to manage calendar events.
    p_event_coststringfalse Permission to manage lesson costs.
    p_accountingstringfalse Permission to access accounting data.
    p_reportsstringfalse Permission to generate reports.
    p_settingsstringfalse Permission to manage company settings.
    p_subscriptionstringfalse Permission to manage the company's subscription.
    p_student_contactstringfalse Permission to view student contact information.
    p_events_othersstringfalse Permission to manage non-teaching events.
    p_events_durationstringfalse Permission to manage event duration.
    p_locationsstringfalse Permission to manage locations.
    p_send_notesstringfalse Permission to send shared lesson notes.
    p_teachersstringfalse Permission to manage teacher profiles.
    p_staffstringfalse Permission to manage staff profiles.
    p_tasksstringfalse Permission to create and assign tasks.
    p_event_wagestringfalse Permission to manage wages for lessons and non-teaching events.
    p_payrollstringfalse Permission to manage payroll data.
    p_documentsstringfalse Permission to manage file attachments.
    p_integrationsstringfalse Permission to manage Integrations & Add-Ons.
    p_emailstringfalse Permission to manage emails and email logs.
    created_atstring(date-time)false When the employee profile was created.
    updated_atstring(date-time)false When the employee profile was last updated.
    welcome_sent_atstring(date-time)false When welcome email was last sent.
    custom_fields[any]false An array of custom field objects.
    » namestringfalse Name of custom field.
    » valuestringfalse Value for custom field

    Customer

    {
      "id": 1,
      "customer_type": "family",
      "salutation": "Mr.",
      "first_name": "Jeff",
      "last_name": "Jackson",
      "email": "[email protected]",
      "additional_email": "[email protected]",
      "home_phone": "905-399-0379",
      "mobile_phone": "123-123-1234",
      "work_phone": "905-399-0379",
      "address": "4159 Main Street",
      "address_2": "",
      "city": "Burlington",
      "state": "Ontario",
      "zip": "L7L 1C5",
      "country": "Canada",
      "additional_notes": "Notes about customer can go here.",
      "status": "Active",
      "time_zone": "Eastern Time (US & Canada)",
      "email_lesson_reminders": 1,
      "email_lesson_notes": 1,
      "sms_lesson_reminders": 1,
      "last_invoice_date": "2017-12-31",
      "user_account": 1,
      "stripe_id": "cus_79mHvpN8Qee0JJ",
      "unviewed": false,
      "is_family_contact": false,
      "fmaily_customer_id": "7",
      "created_at": "2017-11-29T17:57:47Z",
      "updated_at": "2018-01-01T18:36:44Z",
      "welcome_sent_at": "2017-11-30T09:38:19Z",
      "custom_fields": [
        {
          "field_id": 13,
          "name": "Preferred Method of Contact",
          "value": "Mobile Phone"
        }
      ]
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for the record.
    customer_typestringfalse The type of customer profile. Can be "individual" or "family"
    salutationstringfalse Salutation for the customer.
    first_namestringfalse Customer's first name.
    last_namestringfalse Customer's last name.
    emailstringfalse Customer's primary email address.
    additional_emailstringfalse An additional email address.
    home_phonestringfalse Customer's home phone number.
    mobile_phonestringfalse Customer's mobile number. If sending SMS, use E.164 format.
    work_phonestringfalse Customer's work number.
    addressstringfalse Address Line 1.
    address_2stringfalse Address Line 2.
    citystringfalse Customer's city of residence.
    statestringfalse Customer's state of residence.
    zipstringfalse Zip or postal code.
    countrystringfalse Customer's country of residence.
    additional_notesstringfalse Additional notes related to the customer.
    statusstringfalse The status of the profile. Can be "Active", "Inactive" or "Prospective"
    time_zonestringfalse Customer's time zone.
    email_lesson_remindersinteger(int32)false Enable or disable lesson reminder emails.
    email_lesson_notesinteger(int32)false Enable or disable sending lesson notes to the customer.
    sms_lesson_remindersinteger(int32)false Enable or disable SMS reminders for the customer.
    last_invoice_datestring(date)false Last time customer received an invoice.
    user_accountinteger(int32)false Enable or disable user access.
    stripe_idstringfalse Unique Stripe identifier for customer.
    unviewedbooleanfalse Set to true to mark profile as "New" in Teachworks
    is_family_contactbooleanfalse Indicates whether or not additional contact is assigned.
    fmaily_customer_idstringfalse Customer identifier for family that contact belongs to.
    created_atstring(date-time)false When the customer profile was created.
    updated_atstring(date-time)false When the customer profile was last updated.
    welcome_sent_atstring(date-time)false Last time welcome email was sent.
    custom_fields[any]false An array of custom field objects.
    » namestringfalse Name of custom field.
    » valuestringfalse Value for custom field

    Student

    {
      "id": 11,
      "customer_id": 10,
      "student_type": "Child",
      "first_name": "Erin",
      "last_name": "Smith",
      "email": "[email protected]",
      "additional_email": "[email protected]",
      "home_phone": "123-123-1234",
      "mobile_phone": "123-123-1234",
      "birth_date": "2014-04-23",
      "start_date": "2018-01-01T15:32:09Z",
      "school": "John Knox",
      "grade": "Kindergarten",
      "additional_notes": "Additional Notes about the student can be added here.",
      "calendar_color": "#98CFC7",
      "default_location_id": 3,
      "status": "Active",
      "time_zone": "Eastern Time (US & Canada)",
      "billing_method": "Package",
      "student_cost": "0",
      "cost_premium_id": 1,
      "discount_rate": "10.25",
      "email_lesson_reminders": 1,
      "email_lesson_notes": 1,
      "sms_lesson_reminders": 1,
      "user_account": 0,
      "unviewed": false,
      "welcome_sent_at": "2018-01-01T15:33:09Z",
      "created_at": "2018-01-01T15:32:01Z",
      "updated_at": "2018-01-02T15:32:09Z",
      "custom_fields": [
        {
          "field_id": 22,
          "name": "ACT Goal",
          "value": "32"
        }
        ],
        "default_teachers": [
          {
            "id": 12,
            "first_name": "Marilyn",
            "last_name": Christiansen
          }
        ]
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    customer_idinteger(int32)false Customer id associated with student.
    student_typestringfalse Type of student profile. Can be "Individual" or "Child".
    first_namestringfalse First name of student.
    last_namestringfalse Last name of student
    emailstringfalse Email address of student.
    additional_emailstringfalse Additional email address.
    home_phonestringfalse Student's home number.
    mobile_phonestringfalse Student's mobile number. If sending SMS use E.164 format.
    birth_datestring(date)false Student's date of birth YYMMDD.
    start_datestringfalse Student's start date.
    schoolstringfalse Student's school.
    gradestringfalse Student's current grade.
    additional_notesstringfalse Additional notes related to student.
    calendar_colorstringfalse Student's default calendar color.
    default_location_idinteger(int32)false Identifier for default location assigned to student.
    statusstringfalse Status of student profile. Can be "Active", "Inactive" or "Prospective".
    time_zonestringfalse Student's time zone.
    billing_methodstringfalse Student's billing method. Can be "Package", "Student Cost", "Service List Cost" or "Flat Fee".
    student_coststringfalse Lesson cost assigned to student if using "Student Cost".
    cost_premium_idinteger(int32)false Unique identifier for assigned cost premium.
    discount_ratestringfalse Discount rate applied to student's lessons.
    email_lesson_remindersinteger(int32)false Enable/disable email lesson reminders for student.
    email_lesson_notesinteger(int32)false Enable/disable option to receive lesson notes.
    sms_lesson_remindersinteger(int32)false Enable/disable SMS lesson reminders for student.
    user_accountinteger(int32)false Enable/disable user access for student.
    unviewedbooleanfalse Set to true to mark profile as "New" in Teachworks
    welcome_sent_atstringfalse When welcome email was last sent.
    created_atstring(date-time)false When student profile was created.
    updated_atstring(date-time)false When student profile was last updated.
    custom_fields[any]false An array of custom field objects.
    » namestringfalse Name of custom field.
    » valuestringfalse Value for custom field

    Lesson

    {
      "id": 20,
      "name": "English Lesson",
      "description": "Enter a description for the lesson here.",
      "series_id": 22,
      "location_name": "Downtown Office",
      "location_id": 3,
      "employee_name": "Morrison, Ashley",
      "employee_id": 4,
      "service_name": "Math Tutoring",
      "service_id": 3,
      "spaces": "NULL",
      "joinable": "NULL",
      "from_date": "2018-01-02",
      "from_time": "16:00:00",
      "to_date": "2018-01-02",
      "to_time": "17:00:00",
      "time_zone": "Eastern Time (US & Canada)",
      "from_datetime": "2018-01-02T21:00:00Z",
      "to_datetime": "2018-01-02T22:00:00Z",
      "duration_minutes": 60,
      "status": "Attended",
      "custom_status": "NULL",
      "wage": "25",
      "wage_premium": "0.0",
      "wage_payment_id": 14,
      "cost_override": "NULL",
      "override_method": "NULL",
      "override_value": "NULL",
      "request_comments": "NULL",
      "requested_at": "NULL",
      "request_customer_id": "NULL",
      "request_student_id": "NULL",
      "vehicle_id": "NULL",
      "sms_sent_at": "2018-01-01T16:00:00Z",
      "reminder_sent_at": "2018-01-01T16:00:00Z",
      "cancelled_sent_at": "NULL",
      "completed_at": "NULL",
      "created_at": "2017-12-25T15:55:17Z",
      "updated_at": "2018-01-02T16:00:00Z",
      "participants": [
        {
          "id": 1,
          "lesson_id": 3,
          "student_name": "Anderson, Katie",
          "student_id": 11,
          "description": "Enter a description for the lesson here.",
          "status": "Attended",
          "custom_status": "NULL",
          "unit_price": "40",
          "cost_premium_included": "0.0",
          "discount_rate": "0.0",
          "amount": "40",
          "cost_override_method": "NULL",
          "public_notes": "Shared notes can be entered here.",
          "private_notes": "Notes for internal use can be entered here.",
          "invoice_id": "32",
          "notes_sent_at": "2018-01-08T10:00:03Z",
          "student_reminder_sent_at": "2018-01-06T18:00:00Z",
          "family_reminder_sent_at": "2018-01-06T18:00:00Z",
          "student_sms_sent_at": "2018-01-06T18:00:00Z",
          "family_sms_sent_at": "2018-01-06T18:00:00Z",
          "cancelled_sent_at": "NULL",
          "completed_at": "2018-01-07T18:35:08Z",
          "created_at": "2017-12-24T15:07:20Z",
          "updated_at": "2018-01-07T18:35:08Z"
        }
      ]
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for the record.
    namestringfalse Title of the lesson.
    descriptionstringfalse Description of the lesson.
    series_idinteger(int32)false Unique identifier for the series for repeating lessons.
    location_namestringfalse Name of location where lesson takes place.
    location_idinteger(int32)false Unique identifier for assigned location.
    employee_namestringfalse Name of teacher for lesson.
    employee_idinteger(int32)false Unique identifier for assigned employee.
    service_namestringfalse Name of service type for lesson.
    service_idinteger(int32)false Unique identifier for assigned service.
    spacesstringfalse Number of available spaces.
    joinablestringfalse Indicates whether or not it's an open lesson.
    from_datestring(date)false Start date of lesson YYYY-MM-DD.
    from_timestringfalse Start time of lesson.
    to_datestring(date)false End date of lesson YYYY-MM-DD.
    to_timestringfalse End time of lesson.
    time_zonestringfalse Time zone assigned to lesson.
    from_datetimestring(date-time)false Start date and time of lesson.
    to_datetimestring(date-time)false End date and time of lesson.
    duration_minutesinteger(int32)false Duration of lesson in minutes.
    statusstringfalse Status assigned to lesson. Can be "Scheduled", "Attended", "Missed" or "Cancelled".
    custom_statusstringfalse Custom status assigned to lesson if using Custom Lesson Statuses Add-On.
    wagestringfalse Employee wage assigned to lesson.
    wage_premiumstringfalse Wage premium assigned to student.
    wage_payment_idinteger(int32)false Identifier of wage payment that this lesson was paid to teacher in.
    cost_overridestringfalse Option to override default lesson cost method.
    override_methodstringfalse Can be set to “Service List Cost”, “Student Profile Price”, “Custom Price - Adjusted” or “Custom Price - Unadjusted”
    override_valuestringfalse Value to replace default.
    request_commentsstringfalse Comments submitted for requested lessons.
    requested_atstringfalse Timestamp of when a lesson was requested.
    request_customer_idintegerfalse Identifier for customer that requested the lesson.
    request_student_idintegerfalse Identifier for student that requested lesson.
    vehicle_idstringfalse Unique identifier for assigned vehicle.
    sms_sent_atstringfalse When SMS lesson reminder was sent.
    reminder_sent_atstringfalse When email lesson reminder was sent.
    cancelled_sent_atstringfalse When the lesson was cancelled.
    completed_atstringfalse When the lesson was last completed.
    created_atstring(date-time)false When the lesson was created.
    updated_atstring(date-time)false When the lesson was last edited.
    participants[LessonParticipant]false An array of lesson participants.

    LessonParticipant

    {
      "id": 1,
      "lesson_id": 3,
      "student_name": "Anderson, Katie",
      "student_id": 11,
      "description": "Enter a description for the lesson here.",
      "status": "Attended",
      "custom_status": "NULL",
      "unit_price": "40",
      "cost_premium_included": "0.0",
      "discount_rate": "0.0",
      "amount": "40",
      "cost_override_method": "NULL",
      "public_notes": "Shared notes can be entered here.",
      "private_notes": "Notes for internal use can be entered here.",
      "invoice_id": "32",
      "notes_sent_at": "2018-01-08T10:00:03Z",
      "student_reminder_sent_at": "2018-01-06T18:00:00Z",
      "family_reminder_sent_at": "2018-01-06T18:00:00Z",
      "student_sms_sent_at": "2018-01-06T18:00:00Z",
      "family_sms_sent_at": "2018-01-06T18:00:00Z",
      "cancelled_sent_at": "NULL",
      "completed_at": "2018-01-07T18:35:08Z",
      "created_at": "2017-12-24T15:07:20Z",
      "updated_at": "2018-01-07T18:35:08Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for the record.
    lesson_idinteger(int32)false Unique identifier for the lesson that the participant record belongs to.
    student_namestringfalse Name of student enrolled in lesson.
    student_idinteger(int32)false Unique identifier for assigned student.
    descriptionstringfalse The lesson's description.
    statusstringfalse The status of the lesson. Can be "Attended", "Cancelled", "Missed" or "Scheduled".
    custom_statusstringfalse The custom status of the lesson if using Custom Lesson Statuses Add-On.
    unit_pricestringfalse Lesson cost assigned to lesson.
    cost_premium_includedstringfalse Cost premium assigned to lesson.
    discount_ratestringfalse Discount rate applied to lesson.
    amountstringfalse Lesson cost with cost premium and discount applied.
    cost_override_methodstringfalse Method of cost override if used.
    public_notesstringfalse Shared lesson notes that can be emailed to customers.
    private_notesstringfalse Private lesson notes for internal use.
    invoice_idstringfalse Unique identifier for assigned invoice.
    notes_sent_atstringfalse When lesson notes were last emailed.
    student_reminder_sent_atstringfalse When lesson reminder email was sent to assigned student.
    family_reminder_sent_atstringfalse When lesson reminder email was sent to assigned family.
    student_sms_sent_atstringfalse When SMS lesson reminder was sent to assigned student.
    family_sms_sent_atstringfalse When SMS lesson reminder was sent to assigned family.
    cancelled_sent_atstring(date-time)false When Cancellation Notification was sent.
    completed_atstringfalse When lesson was last completed.
    created_atstring(date-time)false When lesson was created.
    updated_atstring(date-time)false When lesson was last updated.

    OtherEvent

    {
      "id": 16,
      "name": "Admin Duties",
      "description": "",
      "audience": "Everyone",
      "series_id": 6,
      "location_id": 2,
      "job_id": 3,
      "from_date": "2018-01-10",
      "from_time": "12:00:00",
      "to_date": "2018-01-10",
      "to_time": "14:00:00",
      "time_zone": "Eastern Time (US & Canada)",
      "from_datetime": "2018-01-10T17:00:00Z",
      "to_datetime": "2018-01-10T19:00:00Z",
      "duration_minutes": 120,
      "is_all_day": false,
      "created_at": "2018-01-09T15:57:45Z",
      "updated_at": "2018-01-10T15:37:24Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    namestringfalse Name of non-teaching event.
    descriptionstringfalse Description of non-teaching event.
    audiencestringfalse Users assigned to non-teaching event.
    series_idinteger(int32)false Identifier for repeating series that the lesson belongs to.
    location_idinteger(int32)false Unique identifier for location assigned to non-teaching event.
    job_idinteger(int32)false Identifier for type of job of the event.
    from_datestring(date)false Start date for event.
    from_timestringfalse Start time for event.
    to_datestring(date)false End date for event.
    to_timestringfalse End time for event.
    time_zonestringfalse Time zone assigned to non-teaching event.
    from_datetimestring(date-time)false Start date and time of non-teaching event.
    to_datetimestring(date-time)false End date and time of non-teaching event.
    duration_minutesinteger(int32)false Duration of non-teaching event in minutes.
    is_all_daybooleanfalse Indicates whether or not it's an all day event.
    created_atstring(date-time)false When the event was created.
    updated_atstring(date-time)false When the event was last updated.

    Availability

    {
      "id": 1,
      "employee_id": 11,
      "day": "5",
      "start_time": "17:00:00",
      "end_time": "20:00:00",
      "description": "Add notes here.",
      "created_at": "2017-07-21T15:49:09Z",
      "updated_at": "2017-09-08T17:58:14Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    employee_idinteger(int32)false Unique identifier for associated employee.
    daystringfalse Day of the week.
    start_timestringfalse Start time of availability.
    end_timestringfalse End time of availability.
    descriptionstringfalse Description of availability.
    created_atstring(date-time)false When the availability was created.
    updated_atstring(date-time)false When the availability was last updated.

    Unavailability

    {
      "id": 59,
      "series_id": 38,
      "employee_id": 3,
      "description": "Personal Leave",
      "from_date": "2018-01-01",
      "from_time": "15:00:00",
      "to_date": "2018-01-03",
      "to_time": "15:00:00",
      "time_zone": "Eastern Time (US & Canada)",
      "from_datetime": "2018-01-01T20:00:00Z",
      "to_datetime": "2018-01-03T20:00:00Z",
      "created_at": "2017-12-31T23:09:24Z",
      "updated_at": "2018-01-01T15:29:59Z"
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for the record.
    series_idinteger(int32)false Identifier for repeating series.
    employee_idinteger(int32)false Unique identifier for assigned employee.
    descriptionstringfalse Description of unavailability.
    from_datestring(date)false Unavailability start date.
    from_timestringfalse Unavailability start time.
    to_datestring(date)false Unavailability end date.
    to_timestringfalse Unavailability end time.
    time_zonestringfalse Time zone assigned to unavailability.
    from_datetimestring(date-time)false Unavailability start date and time.
    to_datetimestring(date-time)false Unavailability end date and time.
    created_atstring(date-time)false When unavailability was created.
    updated_atstring(date-time)false When unavailability was last updated.

    Invoice

    {
          "id": 259,
          "customer_id": 13,
          "invoice_type": "invoice",
          "number": 216,
          "date": "2018-07-01",
          "due_date": "2018-07-31",
          "reference": ,
          "tax_treatment": "Tax Exclusive",
          "status": "Approved",
          "start_date": "2018-07-01",
          "end_date": "2018-07-31",
          "lesson_status": "Scheduled",
          "terms_text": "Please pay online by the due date listed.",
          "subtotal": "55.25",
          "sales_tax_total": "0.00",
          "total": "55.25",
          "hide_flags": false,
          "sent_at": "2018-07-01T23:09:24Z",
          "reminder_sent_at": "2018-07-31T23:09:24Z",
          "created_at": "2018-07-17T23:09:24Z",
          "updated_at": "2018-07-17T23:09:24Z",
          "lessons": [],
          "charges": [],
          "packages": []
        }
        

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    customer_idinteger(int32)false Unique identifier for associated customer.
    invoice_typestringfalse Type of invoice (invoice or credit)
    numberinteger(int32)false Number assigned to invoice (excludes prefix)
    datestringfalse Date of invoice.
    due_datestringfalse Due date of invoice.
    referencestringfalse Text entered in reference field on invoice
    tax_treatmentstringfalse Tax treatment (Tax Exclusive, Tax Inclusive, or Tax Exempt)
    statusstringfalse Invoice status (Saved, Approved, or Paid)
    start_datestringfalse Start date for invoices that include lessons
    end_datestringfalse End date for invoices that include lessons
    lesson_statusstringfalse Status of lessons to include on invoice
    terms_textstringfalse Invoice terms/instructions
    subtotalstringfalse Invoice subtotal
    sales_tax_totalstringfalse Sales tax on invoice
    totalstringfalse Invoice Total
    hide_flagsbooleanfalse Indicates if flags hidden (for lessons that have changed on calendar relative to invoice)
    sent_atstring(date-time)false Timestamp of when invoice was last sent.
    reminder_sent_atstring(date-time)false Timestamp of when invoice reminder was last sent.
    created_atstring(date-time)false When the invoice was created.
    updated_atstring(date-time)false When the invoice was last updated.
    lessonsstring(date-time)false Array of lessons included on the invoice.
    chargesstring(date-time)false Array of charges on the invoice
    packagesstring(date-time)false Array of packages on the invoice

    Payment

    {
      "id": 259,
      "customer_id": 13,
      "date": "2018-07-17",
      "amount": 55.25,
      "description": Payment for INV-0216,
      "payment_method": Cash,
      "type": payment,
      "stripe_transaction_id": null,
      "sent_at": "2018-07-17T23:09:24Z",
      "created_at": "2018-07-17T23:09:24Z",
      "updated_at": "2018-07-17T23:09:24Z",
      "refunds": [],
      "payment_allocations": []
    }
    

    Attributes

    Name Description
    idinteger(int32)false Unique identifier for record.
    customer_idinteger(int32)false Unique identifier for associated customer.
    datestringfalse Date of payment.
    amountstringfalse Amount of payment
    descriptionstringfalse Payment details or description.
    typestringfalse Payment or refund
    payment_methodstringfalse Method of payment. Options include Cash, Check, Credit Card, Debit Card, Bank Transfer, PayPal, Other
    sent_atstring(date-time)false Timestamp of when payment receipt email was sent.
    created_atstring(date-time)false When the payment was created.
    updated_atstring(date-time)false When the payment was last updated.
    refundsstring(date-time)false Array of refunds associated with the payment.
    payment_allocationsstring(date-time)false Array of allocations to invoices