Overview

Ledgerble provides a simple, REST-based API so you can insert, update, and delete data from your Ledgerble account. The API exposes the full functionality of the webapp. Client libaries for Python, Ruby, and PHP are currently in development and will be released on GitHub.

The base URL of the current version of the API is:

https://secure.ledgerble.com/api/1.0/

Please note that all communication with the API must be done over https.

Request & Response Formats

All requests made to the Ledgerble API must pass arguments in as plain GET or POST variables. The API does not accept XML or JSON input data at this time.

For the time being, all API responses are in JSON format. XML support is coming soon.

Example Ledgerble API request:

Request:

wget https://secure.ledgerble.com/api/1.0/?api_token={API_TOKEN}

Response:

{
  "welcome": "Welcome to Ledgerble, Demo Company Inc."
}

Authentication

Authentication is done with an API token, which is unique to every user account (Note: there can be multiple users in each Ledgerble company account, each user will have their own API token). The token can be passed into the request as either a GET or POST variable, and must be named "api_token" (see example above).

Important: each user's API token will change every time he or she updates their password in the Ledgerble webapp.

Status Codes

The Ledgerble API returns the following status codes, depending on the result of your request:

  • 200 OK
  • 400 Bad request: something about the request was incorrect (you didn't include all required options, there was a validation error, etc.)
  • 403 Not authoirzed
  • 404 Not found: the resource you tried to access doesn't exist, was deleted, or belongs to another account.
  • 500 Something went wrong on our servers, probably not your fault.

Errors

All errors returned will carry the appropriate HTTP status code (see above) and the following JSON in the body of the response:

{
  "error": "The error message will be here."
}

API Documentation

To get more information on the various API methods available, the required and optional arguments, and the possible return values, please use the menu on the left or consult the list below.

  • Accounts & Categories: Accounts in the API can represent physical accounts such as bank accounts, credit cards, or lines of credit - but are also used for sales and expense categories (advertising, rent, telecomm, etc).

  • Invoices: The invoice methods are used for both income and expenses. Two separate resources are exposed; invoices themselves, as well as their line items.

  • Payments: Recording a payment on an invoice (either income or expense) is done here.

  • Contacts: Contacts are people, businesses, or agencies your company does business with - you either buy things from them, or sell things to them.

  • Reports: Various standard accounting reports are available, including balance sheet, income statement, and sales tax reports.

  • Users: Manage access to your account by creating, updating, or deleting users.

  • Sales Taxes: The sales taxes you charge your customers, or those you are charged when you purchase items from your vendors, are managed here.

  • Settings: Manage your company name and address, and various accounting settings such as invoice numbering.