Skip to Main Content
×
Freshbooks
Official App
Free – Google Play
Get it
FreshBooks is Loved by American Small Business Owners
FreshBooks is Loved by Canadian Small Business Owners
FreshBooks is Loved by Small Business Owners in the UK
Dev Blog

FreshBooks API List Methods: Now All You Need

by paul on August 12/2009

I’m happy to announce a recent change that we’ve made to the way .list methods are handled in the FreshBooks API. Instead of returning a subset of the fields returned by the corresponding .get method, *.list methods now return all of the data.

What does this mean? Well, for example, previous to this change calling invoice.list would return a list of invoices with the following fields: invoice_id, number, client_id, recurring_id, organization, status, amount, amount_outstanding, and date. If you wanted more information, you would have to iterate over each of the results and call invoice.get for each one. This was cumbersome, and if you had a lot of records to go through, it would take quite a bit of time and unnecessarily eat up your daily API request limit. Now you can get all of that information in one invoice.list request.

List Request

<request method="invoice.list" />

Response

<response xmlns="https://www.freshbooks.com/api" status="ok">
<invoices page="1" per_page="25" pages="1" total="2">
<invoice>
<invoice_id>344</invoice_id>
<client_id>3</client_id>
<number>FB00004</number>
<amount>45.6</amount>
<amount_outstanding>0</amount_outstanding>
<status>paid</status>
<date>2009-06-23</date>
<po_number></po_number>
<discount>0</discount>
<notes>Due upon receipt.</notes>
<terms>Payment due in 30 days.</terms>
<url deprecated="true">https://2ndsite.freshbooks.com/inv/1-1-6d30b</url>
<auth_url deprecated="true">https://2ndsite.freshbooks.com/inv/1-1-6d30b-z</auth_url>
<links>
<client_view>https://2ndsite.freshbooks.com/inv/1-1-6d30b</client_view>
<view>https://2ndsite.freshbooks.com/inv/1-1-6d30b-z</view>
<edit>https://2ndsite.freshbooks.com/inv/1-1-6d30b-e</edit>
</links>
<recurring_id>15</recurring_id>
<organization>ABC Corp</organization>
<first_name>John</first_name>
<last_name>Doe</last_name>
<p_street1>123 Fake St.</p_street1>
<p_street2>Unit 555</p_street2>
<p_city>New York</p_city>
<p_state>New York</p_state>
<p_country>United States</p_country>
<p_code>553132</p_code>
<lines>
<line>
<amount>40</amount>
<name>Yard work</name>
<description>Mowed the lawn</description>
<unit_cost>10</unit_cost>
<quantity>4</quantity>
<tax1_name>GST</tax1_name>
<tax2_name>PST</tax2_name>
<tax1_percent>8</tax1_percent>
<tax2_percent>6</tax2_percent>
</line>
</lines>
</invoice>
<invoice>
<invoice_id>345</invoice_id>
<client_id>3</client_id>
<number>FB00005</number>
<amount>570.0</amount>
<amount_outstanding>0</amount_outstanding>
<status>paid</status>
<date>2009-06-24</date>
<po_number></po_number>
<discount>0</discount>
<notes>Due upon receipt.</notes>
<terms>Payment due in 30 days.</terms>
<url deprecated="true">https://2ndsite.freshbooks.com/inv/1-2-6d30b</url>
<auth_url deprecated="true">https://2ndsite.freshbooks.com/inv/1-2-6d30b-z</auth_url>
<links>
<client_view>https://2ndsite.freshbooks.com/inv/1-2-6d30b</client_view>
<view>https://2ndsite.freshbooks.com/inv/1-2-6d30b-z</view>
<edit>https://2ndsite.freshbooks.com/inv/1-2-6d30b-e</edit>
</links>
<recurring_id></recurring_id>
<organization>XYZ Publishing Co</organization>
<first_name>Jane</first_name>
<last_name>Author</last_name>
<p_street1>321 Notreal St.</p_street1>
<p_street2>Suite 380</p_street2>
<p_city>Toronto</p_city>
<p_state>Ontario</p_state>
<p_country>Canada</p_country>
<p_code>M5S2M2</p_code>
<lines>
<line>
<amount>20</amount>
<name>Consulting</name>
<description>Reviewed draft of book</description>
<unit_cost>100</unit_cost>
<quantity>5</quantity>
<tax1_name>GST</tax1_name>
<tax2_name>PST</tax2_name>
<tax1_percent>6</tax1_percent>
<tax2_percent>8</tax2_percent>
</line>
</lines>
</invoice>
</invoices>
</response>

This, along with the update tracking changes we’ve made should help reduce the amount of effort it takes to get at your FreshBooks data. As always, you can get the whole story at our API documentation pages.