Estimates
Note
In order to access these methods via the API, the CurdBee account used must have the Estimates module enabled.
List
GET /estimates.(json|xml)
Returns a collection of estimates associated with the authenticated user’s account. The results will be paginated. You can use the following optional parameters to traverse the results.
- per_page – Number of results per page (default: 20)
- page – Page in result-set
- client – ID of the client to scope the estimates
Sample JSON Response
Status: 200 OK [ { "estimate": { "created_at": "2010-09-22T19:22:27Z", "total_billed": "₴1600.00", "line_items": [ { "price": "60.00", "name_and_description": "Site Revamp", "quantity": 25.0, "sort_order": null, "total": "1500.00", "id": 32677, "unit": "hour" }, { "price": "10.00", "name_and_description": "Domain Registration", "quantity": 10.0, "sort_order": null, "total": "100.00", "id": 32678, "unit": "domain" } ], "notes": "Accept the Invoice if you like to proceed.", "tax2_compound": null, "updated_at": "2010-09-22T19:22:28Z", "discount_amount": "₴0.00", "date": "2010-09-23", "hash_key": "Mu7wJCZh", "id": 9297, "tax_amount": "₴0.00", "client": { "name": "ABC Inc.", "id": 6470 }, "total_due": "₴1600.00", "tax2_amount": "₴0.00", "sub_total": "₴1600.00", "summary": "Online Presence for the company", "paid_total": "₴0.00", "estimate_no": "EST-0001", "state": "sent" } } ]
Sample XML Response
Status: 200 OK <?xml version="1.0" encoding="UTF-8"?> <estimates type="array"> <estimate> <created-at>2010-09-22T19:22:27Z</created-at> <total-billed>₴1600.00</total-billed> <line-items type="array"> <line-item> <price>60.00</price> <name-and-description>Site Revamp</name-and-description> <quantity type="float">25.0</quantity> <sort-order nil="true"></sort-order> <total>1500.00</total> <id type="integer">32677</id> <unit>hour</unit> </line-item> <line-item> <price>10.00</price> <name-and-description>Domain Registration</name-and-description> <quantity type="float">10.0</quantity> <sort-order nil="true"></sort-order> <total>100.00</total> <id type="integer">32678</id> <unit>domain</unit> </line-item> </line-items> <notes>Accept the Invoice if you like to proceed.</notes> <tax2-compound nil="true"></tax2-compound> <updated-at>2010-09-22T19:22:28Z</updated-at> <discount-amount>₴0.00</discount-amount> <date>2010-09-23</date> <hash-key>Mu7wJCZh</hash-key> <id type="integer">9297</id> <tax-amount>₴0.00</tax-amount> <client> <name>ABC Inc.</name> <id type="integer">6470</id> </client> <total-due>₴1600.00</total-due> <tax2-amount>₴0.00</tax2-amount> <sub-total>₴1600.00</sub-total> <summary>Online Presence for the company</summary> <paid-total>₴0.00</paid-total> <estimate-no>EST-0001</estimate-no> <state>sent</state> </estimate> </estimates>
Show Top
GET /estimates/#{id}.(json|xml)
Returns a specific estimate from the authenticated user’s account.
Sample JSON Response
Status: 200 OK { "estimate": { "created_at": "2010-09-22T19:22:27Z", "total_billed": "₴1600.00", "line_items": [ { "price": "60.00", "name_and_description": "Site Revamp", "quantity": 25.0, "sort_order": null, "total": "1500.00", "id": 32677, "unit": "hour" }, { "price": "10.00", "name_and_description": "Domain Registration", "quantity": 10.0, "sort_order": null, "total": "100.00", "id": 32678, "unit": "domain" } ], "notes": "Accept the Invoice if you like to proceed.", "tax2_compound": null, "updated_at": "2010-09-22T19:22:28Z", "discount_amount": "₴0.00", "date": "2010-09-23", "hash_key": "Mu7wJCZh", "id": 9297, "tax_amount": "₴0.00", "client": { "name": "ABC Inc.", "id": 6470 }, "total_due": "₴1600.00", "tax2_amount": "₴0.00", "sub_total": "₴1600.00", "summary": "Online Presence for the company", "paid_total": "₴0.00", "estimate_no": "EST-0001", "state": "sent" } }
Sample XML Response
Status: 200 OK <?xml version="1.0" encoding="UTF-8"?> <estimate> <created-at>2010-09-22T19:22:27Z</created-at> <total-billed>₴1600.00</total-billed> <line-items type="array"> <line-item> <price>60.00</price> <name-and-description>Site Revamp</name-and-description> <quantity type="float">25.0</quantity> <sort-order nil="true"></sort-order> <total>1500.00</total> <id type="integer">32677</id> <unit>hour</unit> </line-item> <line-item> <price>10.00</price> <name-and-description>Domain Registration</name-and-description> <quantity type="float">10.0</quantity> <sort-order nil="true"></sort-order> <total>100.00</total> <id type="integer">32678</id> <unit>domain</unit> </line-item> </line-items> <notes>Accept the Invoice if you like to proceed.</notes> <tax2-compound nil="true"></tax2-compound> <updated-at>2010-09-22T19:22:28Z</updated-at> <discount-amount>₴0.00</discount-amount> <date>2010-09-23</date> <hash-key>Mu7wJCZh</hash-key> <id type="integer">9297</id> <tax-amount>₴0.00</tax-amount> <client> <name>ABC Inc.</name> <id type="integer">6470</id> </client> <total-due>₴1600.00</total-due> <tax2-amount>₴0.00</tax2-amount> <sub-total>₴1600.00</sub-total> <summary>Online Presence for the company</summary> <paid-total>₴0.00</paid-total> <estimate-no>EST-0001</estimate-no> <state>sent</state> </estimate>
Create Top
POST /estimates.(json|xml)
Creates a new estimate under the authenticated user’s account. Only `client_id` is required, all other parameters are optional. Returns the created estimate as the response.
Note
If the date or estimate_no is not set, they will take the following default values.
date – today’s date
estimate_no – next in sequence based on last estimate number. (EST-0001 if it’s the first estimate)
Sample JSON Request
{ "estimate": { "tax": "25.00", "line_items_attributes": [ { "name_and_description": "Sample Item", "price": 25.0, "quantity": 1, "unit": "hour" }, { "name_and_description": "Another Entry", "price": 150.0, "quantity": 1, "unit": "KM" } ], "discount": "10%", "notes": "We can add notes too", "date": "2010/09/25", "shipping": "10.00", "client_id": 4, "summary": "This is a sample estimate", "estimate_no": "EST-NEW" } }
Sample JSON Response
Status: 201 Created Location: http://example.curdbee.com/estimates/#{id} { "estimate": { "id": #{id}, ... } }
Sample XML Request
<?xml version="1.0" encoding="UTF-8"?> <estimate> <tax>25.00</tax> <discount>10%</discount> <line-items-attributes type="array"> <line-items-attribute> <price type="float">25.0</price> <name-and-description>Sample Item</name-and-description> <quantity type="integer">1</quantity> <unit>hour</unit> </line-items-attribute> <line-items-attribute> <price type="float">150.0</price> <name-and-description>Another Entry</name-and-description> <quantity type="integer">1</quantity> <unit>KM</unit> </line-items-attribute> </line-items-attributes> <notes>We can add notes too</notes> <shipping>10.00</shipping> <date type="date">2010-09-25</date> <client-id type="integer">4</client-id> <summary>This is a sample estimate</summary> <estimate-no>EST-NEW</estimate-no> </estimate>
Sample XML Response
Status: 201 Created
Location: http://example.curdbee.com/estimates/#{id}
<estimate>
...
</estimate>Update Top
PUT /estimates/#{id}.(json|xml)
Updates an existing estimate on the authenticated user’s account. Returns the updated estimate.
Sample JSON Request
{ "estimate": { "line_items_attributes": [ { "_delete": true, "id": 25 }, { "price": 76.0, "name_and_description": "Another Entry:Modified", "id": 26 }, { "price": 150.0, "name_and_description": "New Entry: Appending to the existing estimate", "quantity": 1, "unit": "hourly" } ], "estimate_no": "EST-EDIT" } }
Sample JSON Response
Status: 200 OK Location: http://example.curdbee.com/estimates/#{id} { "estimate": { "id": #{id}, ... } }
Sample XML Request
<?xml version="1.0" encoding="UTF-8"?> <estimate> <line-items-attributes type="array"> <line-items-attribute> <-delete type="boolean">true</-delete> <id type="integer">25</id> </line-items-attribute> <line-items-attribute> <price type="float">76.0</price> <name-and-description>Another Entry:Modified</name-and-description> <id type="integer">26</id> </line-items-attribute> <line-items-attribute> <price type="float">150.0</price> <name-and-description>New Entry: Appending to the existing estimate</name-and-description> <quantity type="integer">1</quantity> <unit>hourly</unit> </line-items-attribute> </line-items-attributes> <estimate-no>EST-EDIT</estimate-no> </estimate>
Sample XML Response
Status: 200 OK
Location: http://example.curdbee.com/estimates/#{id}
<estimate>
<id>#{id}</id>
...
</estimate>Convert Top
POST /estimates/#{id}/convert.(json|xml)
Converts an existing estimate on the authenticated user’s account to an invoice. Returns the created invoice.
Sample JSON Response
Status: 200 OK Location: http://example.curdbee.com/invoices/#{id} { "invoice": { "id": #{id}, ... } }
Sample XML Response
Status: 200 OK
Location: http://example.curdbee.com/invoices/#{id}
<invoice>
<id>#{id}</id>
...
</invoice>Duplicate Top
Updated 16/06/2011 – this function is now deprecated.
Close Top
POST /estimates/#{id}/close.(json|xml)
Closes an existing estimate on the authenticated user’s account.
Sample XML/JSON Response
Status: 200 OK
Reopen Top
POST /estimates/#{id}/reopen.(json|xml)
Reopens a closed estimate on the authenticated user’s account.
Sample XML/JSON Response
Status: 200 OK
Deliver Top
POST /deliver/estimate/#{id}.(json|xml)
Delivers an existing estimate that belongs to authenticated user.
Sample JSON Request
{ "delivery": { "blind_copy": [ "admin@example.com" ], "recipients": [ "test@example.com" ] } }
Sample JSON Response
Status: 200 OK
Sample XML Request
<?xml version="1.0" encoding="UTF-8"?> <delivery> <blind-copy>admin@example.com</blind-copy> <blind-copy>admin2@example.com</blind-copy> <recipients>test@example.com</recipients> <recipients>test2@example.com</recipients> </delivery>
Sample XML Response
Status: 200 OK
Delete Top
DELETE /estimates/#{id}.(json|xml)
Deletes an existing estimate that belongs to the authenticated user.
Sample JSON/XML Response
Status: 200 OK








Estimates
