The project is in a healthy, maintained state
DEAR Inventory Ruby SDK generated from DEAR-OpenAPI Spec 3.0 for https://inventory.dearsystems.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

dear-inventory-ruby

DearInventoryRuby - the Ruby gem for the DEAR Inventory API

This specifing endpoints for DEAR Inventory API

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Package version: 0.1.15
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://www.nnhan.me

Installation

Build a gem

To build the Ruby code into a gem:

gem build dear-inventory-ruby.gemspec

Then either install the gem locally:

gem install ./dear-inventory-ruby-0.1.15.gem

(for development, run gem install --dev ./dear-inventory-ruby-0.1.15.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'dear-inventory-ruby', '~> 0.1.15'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'dear-inventory-ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'dear-inventory-ruby'

# Setup authorization
DearInventoryRuby.configure do |config|
  # Configure API key authorization: accountID
  config.api_key['api-auth-accountid'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['api-auth-accountid'] = 'Bearer'

  # Configure API key authorization: appKey
  config.api_key['api-auth-applicationkey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['api-auth-applicationkey'] = 'Bearer'
end

api_instance = DearInventoryRuby::InventoryApi.new
account = { "Code": "001", "Status": "ACTIVE", "Name": "Accounts Payable test", "Type": "CURRLIAB", "Description": "Outstanding invoices the company has received from suppliers but has not yet paid at balance date", "Class": "LIABILITY", "SystemAccount": "CREDITORS", } # Account | an Account object with properties to create
opts = {
  summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
}

begin
  #Allows you to create an Account
  result = api_instance.create_account(account, opts)
  p result
rescue DearInventoryRuby::ApiError => e
  puts "Exception when calling InventoryApi->create_account: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://inventory.dearsystems.com/ExternalApi/v2

Class Method HTTP request Description
DearInventoryRuby::InventoryApi create_account POST /ref/account Allows you to create an Account
DearInventoryRuby::InventoryApi create_customer POST /customer Allows you to create a customer
DearInventoryRuby::InventoryApi create_payment_term POST /ref/paymentterm Allows you to create a payment term
DearInventoryRuby::InventoryApi create_tax POST /ref/tax Allows you to create a tax
DearInventoryRuby::InventoryApi delete_account DELETE /ref/account Allows you to delete an Account
DearInventoryRuby::InventoryApi delete_payment_term DELETE /ref/paymentterm Allows you to delete a payment term
DearInventoryRuby::InventoryApi get_accounts GET /ref/account Allows you to retrieve the Chart of Accounts
DearInventoryRuby::InventoryApi get_customers GET /customer Allows you to retrieve the customers
DearInventoryRuby::InventoryApi get_me GET /me Allows you to retrieve your information
DearInventoryRuby::InventoryApi get_payment_terms GET /ref/paymentterm Allows you to retrieve the payment terms
DearInventoryRuby::InventoryApi get_price_tiers GET /ref/priceTier Allows you to retrieve the Price Tiers
DearInventoryRuby::InventoryApi get_sale_invoices GET /sale/invoice Allows you to retrieve the sale invoices
DearInventoryRuby::InventoryApi get_taxes GET /ref/tax Allows you to retrieve the taxes
DearInventoryRuby::InventoryApi update_account PUT /ref/account Allows you to update an Account
DearInventoryRuby::InventoryApi update_customer PUT /customer Allows you to update a customer
DearInventoryRuby::InventoryApi update_payment_term PUT /ref/paymentterm Allows you to update a payment term
DearInventoryRuby::InventoryApi update_tax PUT /ref/tax Allows you to update a tax

Documentation for Models

Documentation for Authorization

accountID

  • Type: API key
  • API key parameter name: api-auth-accountid
  • Location: HTTP header

appKey

  • Type: API key
  • API key parameter name: api-auth-applicationkey
  • Location: HTTP header