myERP API

The myERP API gem allows Ruby developers to programmatically access the data of myERP accounts.

The API is implemented as JSON over HTTP using all four verbs (GET/POST/PUT/DELETE). Each resource, like Account, Item, or Order, has its own URL and is manipulated in isolation. In other words, we’ve tried to make the API follow the REST principles as much as possible.

For more information and detailed documentation about the API visit developers.myerp.com

Installation

To easily install or upgrade to the latest release, use gem

gem install myerp_api

Getting Started

The myERP API uses ActiveResource to communicate with the REST web service.

client = MyERP.client('API_EMAIL', 'API_KEY')
# Retrieve all customers and leads
puts client.customers.all

# Get a specific customer/lead
puts client.customers.find(261367)

# Create a customer
customer = MyERP::Customer.new
customer.type = 2 #individual
customer.status = 1 #customer
customer.first_name = "John"
customer.last_name = "Doe"
customer.email = "john.doe@mail.com"

customer = client.customers.save(customer)
puts "#{customer.full_name} created [id=#{customer.id}]"

# Update some fields
customer.first_name = "Jane"
customer = client.customers.save(customer)
puts "#{customer.full_name} updated [id=#{customer.id}]"

# Delete a customer
customer = client.customers.delete(customer)
puts "#{customer.full_name} deleted [id=#{customer.id}]"

Contributing

Thanks for considering contributing to this project.

Finding something to do

Ask, or pick an issue and comment on it announcing your desire to work on it. Ideally wait until we assign it to you to minimize work duplication.

Reporting an issue

Pull requests

Coding style

License

The myERP API gem is released under the MIT License.