{"id":16389286,"url":"https://github.com/marcelog/elixir_freshbooks","last_synced_at":"2025-08-12T16:33:45.470Z","repository":{"id":62428982,"uuid":"45251225","full_name":"marcelog/elixir_freshbooks","owner":"marcelog","description":"An Elixir client for the FreshBooks API","archived":false,"fork":false,"pushed_at":"2017-01-29T02:03:36.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T10:21:54.680Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-30T13:03:24.000Z","updated_at":"2016-01-12T15:14:54.000Z","dependencies_parsed_at":"2022-11-01T20:04:22.181Z","dependency_job_id":null,"html_url":"https://github.com/marcelog/elixir_freshbooks","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Felixir_freshbooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Felixir_freshbooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Felixir_freshbooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Felixir_freshbooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelog","download_url":"https://codeload.github.com/marcelog/elixir_freshbooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240199179,"owners_count":19763820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T04:32:14.889Z","updated_at":"2025-02-22T16:05:48.027Z","avatar_url":"https://github.com/marcelog.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/marcelog/elixir_freshbooks.svg)](https://travis-ci.org/marcelog/elixir_freshbooks)\n\n# ElixirFreshbooks\n\nAn [Elixir](http://elixir-lang.org/) client for the [FreshBooks](http://freshbooks.com) API.\n\nThis is a work *in progress*. This means that there are a limited set of features available (i.e:\nthe ones I need right now :)) so pull requests to add new features are **highly** appreciated :)\n\n----\n\n# Using it with Mix\n\nTo use it in your Mix projects, first add it as a dependency:\n\n```elixir\ndef deps do\n  [{:elixir_freshbooks, \"~\u003e 0.0.7\"}]\nend\n```\nThen run mix deps.get to install it.\n\n----\n\n# Configuring\nIn your config.exs, setup the following section:\n\n```elixir\nconfig :elixir_freshbooks,\n  url: \"https://sample.freshbooks.com/api/2.1/xml-in\",\n  token: \"token\"\n```\n\nIn your freshbooks account you should find both values.\n\n----\n\n# Documentation\n\n## Clients\n\nClients are used via the [Client](https://github.com/marcelog/elixir_freshbooks/blob/master/lib/elixir_freshbooks/client.ex) module.\n\n```elixir\nalias ElixirFreshbooks.Client, as: C\n```\n\n### Creating\n```elixir\n  \u003e C.create(\n    \"first_name\", \"last_name\", \"organization\", \"user@host.com\",\n    \"username\", \"password\"\n  )\n  %ElixirFreshbooks.Client{\n    email: \"user@host.com\",\n    first_name: \"first_name\",\n    id: 4422,\n    last_name: \"last_name\",\n    organization: \"organization\",\n    username: \"username\",\n    password: \"password\"\n  }\n```\n\nBoth `username` and `password` are optional arguments.\n\n### Updating\n```elixir\n  \u003e C.update %ElixirFreshbooks.Client{id: 4422, password: \"new_password\"}\n  :ok\n```\n\n## Invoices\n\nInvoices are used via the [Invoice](https://github.com/marcelog/elixir_freshbooks/blob/master/lib/elixir_freshbooks/invoice.ex) module.\n\n```elixir\nalias ElixirFreshbooks.Invoice, as: I\nalias ElixirFreshbooks.InvoiceLine, as: L\n```\n\n### Creating\n```elixir\n  # Create a new invoice for the client_id 4422, add one line with the given\n  # name, description, unit_cost, and quantity.\n  \u003e I.create 4422, \"sent\", [\"note1\", \"note2\", \"note3\"], [\n    L.new(\"Line Name\", \"Line Description\", 2, 4)\n  ]\n  %ElixirFreshbooks.Invoice{\n    client_id: 4422,\n    id: 9932,\n    lines: [\n      %ElixirFreshbooks.InvoiceLine{\n        description: \"Line Description\",\n        name: \"Line Name\",\n        quantity: 4,\n        type: \"item\",\n        unit_cost: 2\n      }\n    ],\n    notes: [\"note1\", \"note2\", \"note3\"],\n    status: \"sent\"\n  }\n```\n\n### Adding taxes\n```elixir\n  # Taxes are in percent only, not absolute values.\n  \u003e item = L.new(\"Line Name\", \"Line Description\", 2, 4) |\u003e\n    L.tax(\"tax name\", 7) |\u003e\n    L.tax(\"another tax\", 3)\n  \u003e I.create 4422, \"sent\", [\"note1\", \"note2\", \"note3\"], [item]\n\n```\n\n## Payments\n\nPayments are used via the [Payment](https://github.com/marcelog/elixir_freshbooks/blob/master/lib/elixir_freshbooks/payment.ex) module.\n\n```elixir\nalias ElixirFreshbooks.Payment, as: P\n```\n\n### Creating\n```elixir\n  \u003e P.create 889, 10.50, \"Credit Card\", [\"note1\", \"note2\", \"note3\"]\n  %ElixirFreshbooks.Payment{\n    invoice_id: 889,\n    amount: 10.50,\n    id: 778,\n    notes: [\"note1\", \"note2\", \"note3\"],\n    type: \"Credit Card\"\n  }\n```\n\n## Expenses\n\nExpenses are used via the [Expense](https://github.com/marcelog/elixir_freshbooks/blob/master/lib/elixir_freshbooks/expense.ex) module.\n\n```elixir\nalias ElixirFreshbooks.Expense, as: E\n```\n\n### Creating\n```elixir\n  \u003e E.create 1, 1994955, 1.23, \"test vendor\", [\"note1\", \"note2\"]\n  %ElixirFreshbooks.Expense{\n    amount: 1.23,\n    category_id: 1994955,\n    client_id: nil,\n    date: \"2015-12-06\",\n    id: 320343,\n    notes: [\"note1\", \"note2\"],\n    project_id: nil,\n    staff_id: 1,\n    vendor: \"test vendor\"\n  }\n```\n----\n\n# License\nThe source code is released under Apache 2 License.\n\nCheck [LICENSE](https://github.com/marcelog/elixir_freshbooks/blob/master/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelog%2Felixir_freshbooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelog%2Felixir_freshbooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelog%2Felixir_freshbooks/lists"}