FreshBooks API Guide

Estimates

Staff access

Staff do not have access to the API calls listed below.

estimate.create

Create a new estimate and return the corresponding estimate_id.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="estimate.create">
  <estimate>
    <client_id>13</client_id>              # Client being invoiced

    <status>draft</status>                 # One of sent, viewed, disputed, replied, accepted, or draft (default)

    <date>2007-06-23</date>                # If not supplied, defaults to today's date (Optional)
    <po_number>2314</po_number>            # Purchase order number (Optional)
    <discount>10</discount>                # Percent discount (Optional)
    <notes>Due upon receipt.</notes>       # Notes (Optional)
    <terms>Payment due in 30 days.</terms> # Terms (Optional)
    <first_name>John</first_name>          # (Optional)
    <last_name>Smith</last_name>           # (Optional)
    <organization>ABC Corp</organization>  # (Optional)
    <p_street1></p_street1>                # (Optional)
    <p_street2></p_street2>                # (Optional)
    <p_city></p_city>                      # (Optional)
    <p_state></p_state>                    # (Optional)
    <p_country></p_country>                # (Optional)
    <p_code></p_code>                      # (Optional)

    <lines>                                # Specify one or more line elements (Optional)
      <line>
        <name>Yard Work</name>                     # (Optional)
        <description>Mowed the lawn.</description> # (Optional)
        <unit_cost>10</unit_cost>                  # Default is 0
        <quantity>4</quantity>                     # Default is 0
        <tax1_name>GST</tax1_name>                 # (Optional)
        <tax2_name>PST</tax2_name>                 # (Optional)
        <tax1_percent>8</tax1_percent>             # (Optional)
        <tax2_percent>6</tax2_percent>             # (Optional)
      </line>
    </lines>
  </estimate>
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
  <estimate_id>103</estimate_id>
</response>

estimate.update

Update an existing estimate.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="estimate.update">
  <estimate>
    <estimate_id>103</estimate_id>
    ...
  </estimate>
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response status="ok"/>

estimate.get

Retrieve an existing estimate.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="estimate.get">
  <estimate_id>21</estimate_id>
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
  <estimate>
    ...
  </estimate>
</response>

estimate.list

Returns a list of estimates. You can optionally filter by client_id and date.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="estimate.list">
  <client_id>3</client_id>            # Filter by client (Optional)
  <date_from>2007-01-01</date_from>   # Return estimates dated after this arg (Optional)
  <date_to>2007-04-01</date_to>       # Return estimates dated before this arg (Optional)
  <page>1</page>                      # Page number to return, default is 1 (Optional)
  <per_page>10</per_page>             # Number of results per page, default is 25 (Optional)
</request>

Response

<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
  <estimates page="1" per_page="10" pages="3" total="26">
    <estimate>
      <estimate_id>165</estimate_id>
      ...
    </estimate>
    ...
  </estimates>
</response>

estimate.sendByEmail

Send an estimate to the associated client via e-mail.

Request

<?xml version="1.0" encoding="utf-8"?>
<request method="estimate.sendByEmail">
  <estimate_id>21</estimate_id>
</request>