0.0
No commit activity in last 3 years
No release in over 3 years
Ruby client for Centrum Faktur API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Centrum Faktur

Ruby client for Centrum Faktur API

Installation

gem install centrum_faktur

Usage

Request returns Array or Hash, where keys are strings. When other format than json (default) or yaml is specified, response is not parsed. So for xml and pickle requests, string is returned.

require "centrum_faktur"
client = CentrumFaktur::Client.new(login: "your_login", password: "your-password", subdomain: "your-subodomain")
client.invoice.show("/api/1.0/invoices/1/", format: :xml)

Writing invoice to pdf can be done as follows:

File.open("my-invoice.pdf", "w") { |file| file.write(client.invoice.show("/api/1.0/invoices/1/", format: :pdf)) }

All params that respond to strftime (i.e. Date, Time) will be normalized to format required by API, that is: "YYYY-MM-DD"

Account

Only listing accounts is supported via API

client.account.list

Comment

Listing all comments:

client.comment.list

Or listing comments for given resource:

client.comment.list("/api/1.0/estimates/1/comments/")

Creating comment:

You must pass path to resource comment and required attributes:

client.comment.create("/api/1.0/estimates/1/comments/", {body: "cool", is_public: false})

Estimate

Listing all estimates:

client.estimate.list

Monitoring estimate changes (with optional filter param):

client.estimate.list_updates(updated_since: "2012-01-12")

Creating estimate (check required attributes in API description):

client.estimate.create({})

Updating estimate:

client.estimate.update("/api/1.0/estimates/1/", {})

Removing estimate:

client.estimate.destroy("/api/1.0/estimates/1/")

Invoice

Listing all invoices:

client.invoice.list

Monitoring invoice changes:

client.invoice.list_updates

Displaying invoice:

client.invoice.show("/api/1.0/invoices/1/")

Creating invoice (check required attributes in API description):

client.invoice.create({})

Updating invoice:

client.invoice.update("/api/1.0/invoices/1/", {})

Removing invoice:

client.invoice.destroy("/api/1.0/invoices/1/")

User

Only listing users is supported via API

client.user.list

Continuous Integration

Build Status

Copyright

Created during development for Ragnarson

Copyright © Wojciech Wnętrzak. See LICENSE for details.