Skip to main content
Refreshbooks provides a simple synchronous API for manipulating FreshBooks
invoices, clients, and other data::

from refreshbooks import api

c = api.OAuthClient(
'example.freshbooks.com',
'consumerkey',
'My Consumer Secret',
'An existing token',
'An existing token secret',
user_agent='Example/1.0'
)

response = c.invoice.create(
invoice=dict(
client_id='8',
lines=[
api.types.line(
name='Yard Work',
unit_cost='10',
quantity='4'
)
]
)
)

invoice_response = c.invoice.get(
invoice_id=response.invoice_id
)

print "New invoice created: #%s (id %s)" % (
invoice_response.invoice.number,
invoice_response.invoice.invoice_id
)

invoices_response = c.invoice.list()

print "There are %s pages of invoices." % (
invoices_response.invoices.attrib['pages'],
)

for invoice in invoices_response.invoices.invoice:
print "Invoice %s total: %s" % (
invoice.invoice_id,
invoice.amount
)

Consumer keys and secrets can be obtained from FreshBooks. This library
does not handle negotiating for an OAuth token+secret pair; see the
`oauth` module or the OAuth specification for details.

This library also supports the older token-based API authorization
scheme::

c = api.TokenClient(
'example.freshbooks.com',
'My API token',
user_agent='Example/1.0'
)

# ... as above ...

API methods return lxml.objectify.ObjectifiedDataElement trees, which
can be manipulated as Python objects with the same structure as the
underlying XML.

If you are having trouble accessing items as in:

items_response = c.items.list()
for item in items_response.items.item:
print item.item_id

Adjust your syntax to use dictionary item lookup:

items_response = c.items.list()
for item in items_response['items'].item:
print item.item_id

ObjectifiedDataElement provides a method named items which shadows the
items element in the response. Accessing items with dictionary lookup
syntax is the known work-around.

References:

- http://developers.freshbooks.com/ - The FreshBooks API
- http://developers.freshbooks.com/authentication-2/#OAuth - FreshBooks and OAuth

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refreshbooks-1.7.tar.gz (12.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

refreshbooks-1.7-py2.7.egg (21.1 kB view details)

Uploaded Egg

refreshbooks-1.7-py2.6.egg (21.1 kB view details)

Uploaded Egg

File details

Details for the file refreshbooks-1.7.tar.gz.

File metadata

  • Download URL: refreshbooks-1.7.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for refreshbooks-1.7.tar.gz
Algorithm Hash digest
SHA256 067956b66add8add4bd20ab04a334855a3ea2ffdbd06a8cc763c055450328ac9
MD5 822373be13949479e3702afbf7638043
BLAKE2b-256 115b02545ee974fd3c0b340531033c348ec87ec12410e4441ffe9020f58f0c01

See more details on using hashes here.

File details

Details for the file refreshbooks-1.7-py2.7.egg.

File metadata

File hashes

Hashes for refreshbooks-1.7-py2.7.egg
Algorithm Hash digest
SHA256 d3ce4d8947b9a8095931da779d7f883d75945387da31982796c7faeda35f00e4
MD5 e341d98dc77338f010bed9215cc913c2
BLAKE2b-256 58ca3812531bf712ac686de3a040355571ec96572ee9598b060688838e7ad9bc

See more details on using hashes here.

File details

Details for the file refreshbooks-1.7-py2.6.egg.

File metadata

File hashes

Hashes for refreshbooks-1.7-py2.6.egg
Algorithm Hash digest
SHA256 f3ab8de98146adc630e4fcb423c0c1f637a843aa7d46037db1ad8e9c64e95030
MD5 05556fcc47ef71f3e45914c89b508e6c
BLAKE2b-256 52eb8696657cdd3eed2905069c298295db078715790d222244b113fdcb783087

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0

3 files

1.7.2

3 files

1.7.1

3 files

This release

1.7 This release

3 files

1.6.1

3 files

1.6

3 files

1.5

3 files

1.4

2 files

1.3.2

2 files

1.3

2 files

1.2

2 files

1.1

2 files

1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page