Estimates
Permissions
Permission to view, create, edit and delete estimate information is governed by the group a staff member is a part of.
cb_createEstimate
Create a new estimate and return the ID of the newly created estimate.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $client_id | The client_id of the client the estimate is being created for |
| array | $estimate_info |
An array of additional information to use when creating the estimate. The valid fields for this array are:
|
| array | $items |
An array of items to add to the estimate being created. The format of this array is:
|
| int | $status |
optional; The default status of the estimate. The two valid values for this paramater are: 0: Draft, 1: Sent If a status of 1 is set, an estimate email will be sent upon successful creation. |
| int | $creator_id | optional; The ID of the staff member who created the estimate. If left blank, the creator will be set as 'Clientbill' |
Response
cb_editEstimate
Edit an estimate using a given estimate_id.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $estimate_id | The estimate_id of the estimate to be updated |
| int | $client_id | The client_id of the client the estimate is being created for |
| array | $estimate_info |
An array of additional information to use when creating the estimate. The valid fields for this array are:
|
| array | $items |
An array of items to add to the estimate being created. The format of this array is:
|
| int | $status |
optional; The default status of the estimate. The two valid values for this paramater are: 0: Draft, 1: Sent If a status of 1 is set, an estimate email will be sent upon successful creation. |
Response
cb_deleteEstimate
Delete an estimate using the given estimate_id
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $estimate_id | The estimate_id of the estimate to be deleted |
Response
cb_convertToInvoice
Converts an estimate into an invoice using the given estimate_id and return the id of the newly created invoice
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $estimate_id | The estimate_id of the estimate to be converted to an invoice |
Response
cb_getEstimate
Retrieve information for a single estimate using a given estimate_id
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $estimate_id | The estimate_id of the estimate to retrieve |
Response
(
[invoice_id] => 6
[client_id] => 1
[client] => John Doe
[address] => 100 Doe Avenue Apartment #2
[po] => 1001
[status] => Draft
[last_access] => 7/1/2008 12:00PM
[invoice_date] => 6/28/2008 3:30PM
[expiration_date] => 7/14/2008 12:00AM
[subtotal] => 80.00
[tax_total] => 6.40
[total] => 86.40
[special_terms] => Estimate terms
[notes] => Additional estimate notes
[creator_id] => 1
)
cb_getEstimates
Retrieve an array of all estimates ordered by a given column.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $sort_column | The column to sort estimates on. The valid columns that can be used in this function are those returned by the cb_getEstimate() function. |
Response
(
[0] => Array
(
[invoice_id] => 6
[client_id] => 1
[client] => John Doe
[address] => 100 Doe Avenue Apartment #2
[po] => 1001
[status] => Draft
[last_access] => 7/1/2008 12:00PM
[invoice_date] => 6/28/2008 3:30PM
[expiration_date] => 7/14/2008 12:00AM
[subtotal] => 80.00
[tax_total] => 6.40
[total] => 86.40
[special_terms] => Estimate terms
[notes] => Additional estimate notes
[creator_id] => 1
),
[1] => Array
(
[invoice_id] => 7
[client_id] => 2
[client] => Jane Doe
[address] => 101 Doe Avenue Suite #4
[po] => 1002
[status] => Sent
[last_access] => 6/29/2008 4:00PM
[invoice_date] => 6/21/2008 1:00PM
[expiration_date] => 7/17/2008 12:00AM
[subtotal] => 10.00
[tax_total] => 0.00
[total] => 10.00
[special_terms] => Estimate terms
[notes] => Additional estimate notes
[creator_id] => 5
)
)
cb_getClientEstimates
Return an array of estimate IDs for a given client_id. If no estimates exist for the given client, a blank array will be returned.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $client_id | The client_id of the account information to be updated |
Response
[0] => 13,
[1] => 17,
[2] => 26,
[3] => 109,
)
cb_sendEstimate
Send out an estimate email from a given estimate_id.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $estimate_id | The ID of the estimate to send |
Response
cb_exportEstimatesCSV
Returns estimates data for all estimates in a comma separated format. Entries in the returned string are separated by a newline character.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $detailed | optional;
Set what information is to be returned. By default all estimate data, including items, is returned. The valid options for this parameter are: 600 - Show all information, including items 601 - Show only basic information, items are not included |
| int | $limit | optional; Limit the number of results that are returned. |
| int | $offset | optional; By default Clientbill will start with estimate_id = 1. This paramater allows a different starting estimate_id to be used. |
Response
Basic results example:
cb_exportEstimatesXML
Returns estimates data for all estimates in XML format.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $detailed | optional;
Set what information is to be returned. By default all estimate data, including items, is returned. The valid options for this parameter are: 600 - Show all information, including items 601 - Show only basic information, items are not included |
| int | $limit | optional; Limit the number of results that are returned. |
| int | $offset | optional; By default Clientbill will start with estimate_id = 1. This paramater allows a different starting estimate_id to be used. |
Response
<cbExportData>
<estimate>
<invoice_id>6</invoice_id>
<client_id>1</client_id>
<client>John Doe</client>
<address>100 Doe Avenue Apartment #2</address>
<po>1001</po>
<status>Draft</status>
<last_access>7/1/2008 12:00PM</last_access>
<invoice_date>6/28/2008 3:30PM</invoice_date>
<subtotal>80.00</subtotal>
<tax_total>6.40</tax_total>
<total>86.40</total>
<expiration_date>7/14/2008 12:00AM</expiration_date>
<special_terms>Estimate terms</special_terms>
<creator_id>1</creator_id>
<notes>Additional estimate notes</notes>
<items>
<item>
<invoice_item_id>25</invoice_item_id>
<invoice_id>6</invoice_id>
<item_id>1</item_id>
<description_en>Item #1</description_en>
<cost>10.00</cost>
<quantity>7</quantity>
<price>70.00</price>
<tax_item>1</tax_item>
<tax>0.08</tax>
<tax_amount>5.60</tax_amount>
</item>
<item>
<invoice_item_id>26</invoice_item_id>
<invoice_id>6</invoice_id>
<item_id>2</item_id>
<description_en>Item #2</description_en>
<cost>5.00</cost>
<quantity>2</quantity>
<price>10.00</price>
<tax_item>1</tax_item>
<tax>0.08</tax>
<tax_amount>0.80</tax_amount>
</item>
</items>
</estimate>
</cbExportData>