Last active
August 29, 2015 17:44
-
-
Save nmarley/263a47fba5e44dca6715 to your computer and use it in GitHub Desktop.
Freshbooks Category list - 2015-08-29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "category_id": "00002254911", | |
| "name": "Other Expenses", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254912", | |
| "name": "Reference Materials", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254913", | |
| "name": "Business Insurance", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254914", | |
| "name": "Bank Fees", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254915", | |
| "name": "Interest - Mortgage", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254916", | |
| "name": "Interest - Other", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254917", | |
| "name": "Repairs & Maintenance", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254918", | |
| "name": "Taxes & Licenses", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254919", | |
| "name": "Wages", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254920", | |
| "name": "Depreciation", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254921", | |
| "name": "Subscriptions/Dues/Memberships", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254922", | |
| "name": "Commissions", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254923", | |
| "name": "Online Services", | |
| "parent_id": "00002254911" | |
| }, | |
| { | |
| "category_id": "00002254924", | |
| "name": "Advertising", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254925", | |
| "name": "Car & Truck Expenses", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254926", | |
| "name": "Mileage", | |
| "parent_id": "00002254925" | |
| }, | |
| { | |
| "category_id": "00002254927", | |
| "name": "Gas", | |
| "parent_id": "00002254925" | |
| }, | |
| { | |
| "category_id": "00002254928", | |
| "name": "Repairs", | |
| "parent_id": "00002254925" | |
| }, | |
| { | |
| "category_id": "00002254929", | |
| "name": "Vehicle Insurance", | |
| "parent_id": "00002254925" | |
| }, | |
| { | |
| "category_id": "00002254930", | |
| "name": "Vehicle Licensing", | |
| "parent_id": "00002254925" | |
| }, | |
| { | |
| "category_id": "00002254931", | |
| "name": "Contractors", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254932", | |
| "name": "Education and Training", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254933", | |
| "name": "Employee Benefits", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254934", | |
| "name": "Health Insurance", | |
| "parent_id": "00002254933" | |
| }, | |
| { | |
| "category_id": "00002254935", | |
| "name": "Life Insurance", | |
| "parent_id": "00002254933" | |
| }, | |
| { | |
| "category_id": "00002254936", | |
| "name": "Accident Insurance", | |
| "parent_id": "00002254933" | |
| }, | |
| { | |
| "category_id": "00002254937", | |
| "name": "Professional Services", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254938", | |
| "name": "Legal Fees", | |
| "parent_id": "00002254937" | |
| }, | |
| { | |
| "category_id": "00002254939", | |
| "name": "Accounting", | |
| "parent_id": "00002254937" | |
| }, | |
| { | |
| "category_id": "00002254940", | |
| "name": "Meals & Entertainment", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254941", | |
| "name": "Restaurants/Dining", | |
| "parent_id": "00002254940" | |
| }, | |
| { | |
| "category_id": "00002254942", | |
| "name": "Entertainment", | |
| "parent_id": "00002254940" | |
| }, | |
| { | |
| "category_id": "00002254943", | |
| "name": "Office Expenses & Postage", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254944", | |
| "name": "Office Supplies", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254945", | |
| "name": "Software", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254946", | |
| "name": "Hardware", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254947", | |
| "name": "Shipping & Couriers", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254948", | |
| "name": "Postage", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254949", | |
| "name": "Packaging", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254950", | |
| "name": "Stationery", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254951", | |
| "name": "Printing", | |
| "parent_id": "00002254943" | |
| }, | |
| { | |
| "category_id": "00002254952", | |
| "name": "Personal", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254953", | |
| "name": "Rent or Lease", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254954", | |
| "name": "Vehicles", | |
| "parent_id": "00002254953" | |
| }, | |
| { | |
| "category_id": "00002254955", | |
| "name": "Machinery", | |
| "parent_id": "00002254953" | |
| }, | |
| { | |
| "category_id": "00002254956", | |
| "name": "Equipment", | |
| "parent_id": "00002254953" | |
| }, | |
| { | |
| "category_id": "00002254957", | |
| "name": "Office Space", | |
| "parent_id": "00002254953" | |
| }, | |
| { | |
| "category_id": "00002254958", | |
| "name": "Supplies", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254959", | |
| "name": "Travel", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254960", | |
| "name": "Hotel/Lodging/Accommodation", | |
| "parent_id": "00002254959" | |
| }, | |
| { | |
| "category_id": "00002254961", | |
| "name": "Airfare", | |
| "parent_id": "00002254959" | |
| }, | |
| { | |
| "category_id": "00002254962", | |
| "name": "Taxi & Parking", | |
| "parent_id": "00002254959" | |
| }, | |
| { | |
| "category_id": "00002254963", | |
| "name": "Utilities", | |
| "parent_id": null | |
| }, | |
| { | |
| "category_id": "00002254964", | |
| "name": "Gas & Electrical", | |
| "parent_id": "00002254963" | |
| }, | |
| { | |
| "category_id": "00002254965", | |
| "name": "Phone", | |
| "parent_id": "00002254963" | |
| }, | |
| { | |
| "category_id": "00003386168", | |
| "name": "Ingredients", | |
| "parent_id": "00002254958" | |
| }, | |
| { | |
| "category_id": "00005469922", | |
| "name": "Groceries", | |
| "parent_id": "00002254952" | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get a list of all Freshbooks categories... | |
| # their API sucks so bad... fortunately there's a gem. | |
| require 'freshbooks' | |
| require 'pp' | |
| key = ENV['FRESHBOOKS_API_KEY'] | |
| url = ENV['FRESHBOOKS_URL'] | |
| # example from documentation: | |
| # c.invoice.list :client_id => 37, :page => 2, :per_page => 10 | |
| c = FreshBooks::Client.new(url, key) | |
| # don't currently have to paginate if you set the per_page high enough | |
| # (August 2015) | |
| list = c.category.list(per_page: 100) | |
| json = JSON.parse( list["categories"]["category"].to_json ) | |
| puts JSON.pretty_generate(json) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment