odeva/moneybird-client
2
0
Fork
You've already forked moneybird-client
0
Ruby gem for the Moneybird REST API
  • Ruby 99.9%
  • Shell 0.1%
Find a file
Renovate Bot ac8494cd54
All checks were successful
Ruby / test (3.2) (push) Successful in 34s
Ruby / test (3.3) (push) Successful in 32s
Ruby / test (3.4) (push) Successful in 32s
Ruby / test (4) (push) Successful in 31s
Update https://code.forgejo.org/actions/checkout action to v7 ( #13 )
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [https://code.forgejo.org/actions/checkout](https://code.forgejo.org/actions/checkout) | action | major | `v6` → `v7` |
---
### Release Notes
<details>
<summary>actions/checkout (https://code.forgejo.org/actions/checkout)</summary>
### [`v7.0.0`](https://code.forgejo.org/actions/checkout/blob/HEAD/CHANGELOG.md#v700)
[Compare Source](https://code.forgejo.org/actions/checkout/compare/v7...v7)
- Block checking out fork PR for pull\_request\_target and workflow\_run by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2454](https://github.com/actions/checkout/pull/2454)
- Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2458](https://github.com/actions/checkout/pull/2458)
- Bump flatted from 3.3.1 to 3.4.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2460](https://github.com/actions/checkout/pull/2460)
- Bump js-yaml from 4.1.0 to 4.2.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2461](https://github.com/actions/checkout/pull/2461)
- Bump [@&#8203;actions/core](https://github.com/actions/core) and [@&#8203;actions/tool-cache](https://github.com/actions/tool-cache) and Remove uuid by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2459](https://github.com/actions/checkout/pull/2459)
- upgrade module to esm and update dependencies by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2463](https://github.com/actions/checkout/pull/2463)
- Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2462](https://github.com/actions/checkout/pull/2462)
### [`v7`](https://code.forgejo.org/actions/checkout/blob/HEAD/CHANGELOG.md#v700)
[Compare Source](https://code.forgejo.org/actions/checkout/compare/v6.0.3...v7)
- Block checking out fork PR for pull\_request\_target and workflow\_run by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2454](https://github.com/actions/checkout/pull/2454)
- Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2458](https://github.com/actions/checkout/pull/2458)
- Bump flatted from 3.3.1 to 3.4.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2460](https://github.com/actions/checkout/pull/2460)
- Bump js-yaml from 4.1.0 to 4.2.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2461](https://github.com/actions/checkout/pull/2461)
- Bump [@&#8203;actions/core](https://github.com/actions/core) and [@&#8203;actions/tool-cache](https://github.com/actions/tool-cache) and Remove uuid by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2459](https://github.com/actions/checkout/pull/2459)
- upgrade module to esm and update dependencies by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2463](https://github.com/actions/checkout/pull/2463)
- Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2462](https://github.com/actions/checkout/pull/2462)
### [`v6.0.3`](https://code.forgejo.org/actions/checkout/blob/HEAD/CHANGELOG.md#v603)
[Compare Source](https://code.forgejo.org/actions/checkout/compare/v6.0.2...v6.0.3)
- Fix checkout init for SHA-256 repositories by [@&#8203;yaananth](https://github.com/yaananth) in [#&#8203;2439](https://github.com/actions/checkout/pull/2439)
- fix: expand merge commit SHA regex and add SHA-256 test cases by [@&#8203;yaananth](https://github.com/yaananth) in [#&#8203;2414](https://github.com/actions/checkout/pull/2414)
### [`v6.0.2`](https://code.forgejo.org/actions/checkout/blob/HEAD/CHANGELOG.md#v602)
[Compare Source](https://code.forgejo.org/actions/checkout/compare/v6.0.1...v6.0.2)
- Fix tag handling: preserve annotations and explicit fetch-tags by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;2356](https://github.com/actions/checkout/pull/2356)
### [`v6.0.1`](https://code.forgejo.org/actions/checkout/blob/HEAD/CHANGELOG.md#v601)
[Compare Source](https://code.forgejo.org/actions/checkout/compare/v6...v6.0.1)
- Add worktree support for persist-credentials includeIf by [@&#8203;ericsciple](https://github.com/ericsciple) in [#&#8203;2327](https://github.com/actions/checkout/pull/2327)
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
 - At any time (no schedule defined)
- Automerge
 - At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDkuMyIsInVwZGF0ZWRJblZlciI6IjQzLjIwOS4zIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
Reviewed-on: #13 
2026年06月30日 12:32:25 +02:00
.forgejo/workflows Update https://code.forgejo.org/actions/checkout action to v7 ( #13 ) 2026年06月30日 12:32:25 +02:00
bin Support usage of console 2016年08月23日 12:13:34 +02:00
lib add moneybird-client require shim 2026年04月29日 12:03:03 +02:00
spec Update fixtures with missing resource attributes 2026年04月17日 15:51:34 +02:00
.codeclimate.yml Remove duplication 2021年01月07日 10:39:14 +01:00
.gitignore add moneybird-client require shim 2026年04月29日 12:03:03 +02:00
.kick Restructure gem, add minitest specs 2016年03月16日 22:48:17 +01:00
.rspec Initial commit 2016年03月15日 21:37:28 +01:00
.rubocop.yml Add codeclimate 2016年03月17日 22:08:03 +01:00
CODE_OF_CONDUCT.md Initial commit 2016年03月15日 21:37:28 +01:00
Gemfile Update dependency simplecov-cobertura to "~> 3.2" ( #12 ) 2026年06月18日 19:03:05 +02:00
LICENSE.txt Initial commit 2016年03月15日 21:37:28 +01:00
moneybird.gemspec chore: drop 3.1 support, support 4.0 while we're at it 2026年06月18日 16:20:37 +02:00
Rakefile Bump multiple versions 2026年04月10日 16:21:03 +02:00
README.md add moneybird-client require shim 2026年04月29日 12:03:03 +02:00

Moneybird CI

Ruby client for the Moneybird REST API. Supports both personal API tokens and OAuth2 authentication.

Important

This is a fork of maartenvanvliet/moneybird, this is a very solid implementation that I really wanted to build on top of.

Installation

Add this line to your application's Gemfile:

gem 'moneybird-client'

And then execute:

$ bundle

Usage

client = Moneybird::Client.new('your_bearer_token')
# List administrations
administrations = client.administrations
administration = administrations.first
# List invoices
administration.sales_invoices.all
# List invoices with a specific state
administration.sales_invoices.all(filter: 'state:uncollectible')
# List contacts
administration.contacts.all
# Find contact
administration.contacts.find(moneybird_id)
# Find contact by customer id
administration.contacts.find_by_customer_id(customer_id)
# Create contact
administration.contacts.create(company_name: 'ACME', firstname: 'Foo', lastname: 'Bar')
# Update contact
contact = administration.contacts.all.first
contact.company_name = 'Something new'
administrations.contacts.save(contact)
# Delete contact
administrations.contacts.delete(contact)
# Works similarly with other resources

OAuth2

Moneybird uses OAuth2 for authentication. Use Moneybird::OAuth to handle the flow:

oauth = Moneybird::OAuth.new(
 client_id: "your_client_id",
 client_secret: "your_client_secret",
 redirect_uri: "https://yourapp.com/callback"
)
# Step 1: Redirect user
redirect_to oauth.authorize_url(scope: %w[sales_invoices documents])
# Step 2: Exchange code (in callback)
token = oauth.token(params[:code])
# Step 3: Use the token
client = token.client
administrations = client.administrations
# Step 4: Refresh when needed
new_token = oauth.refresh(token.refresh_token)

Available scopes: sales_invoices, documents, estimates, bank, time_entries, settings.

The authorize_url method accepts an optional state parameter for CSRF protection.

Webhooks

Moneybird, if so configured, sends webhooks to specified endpoints. This gem can deal with these requests.

webhook = Moneybird::Webhook.from_json(request.body)
sales_invoice = webhook.build_entity
sales_invoice.state

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on Codeberg at https://codeberg.org/odeva/moneybird. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.