A financial service SDK for ruby for innovative accounting solutions providers.
Lockstep automates accounting workflows to improve your operational efficiency and cash flow. Accelerate payments through automated customer communications, enhanced collections activity management, and innovative forecasting and reporting.
Here's how to add the Lockstep ruby SDK to your project.
- Add the LockstepSdk gem to your Gemfile or install it
gem install lockstep_sdk
-
Obtain an API key for the Lockstep Platform API by visiting: API Key
-
Creating LockstepAPI Client in your ruby file
require 'lockstep_sdk/lockstep_api'
# env can also be prd or your own url addres
env = 'sbx'
client = LockstepSdk::LockstepApi.new(env)
client.with_api_key({INSERT_API_KEY})
- Make a ping call to make sure you're connected https://developer.lockstep.io/reference/v1_status_retrievestatus
status_results = client.status.ping()
puts status_results
You now have your API credentials and have successfully created your client.
This example will show you how to call an API, using the Query Invoices API to retrieve a collection of invoices.
# Connect to Client
# Lockstep provides sandbox and production environments
env = 'sbx'
client = LockstepSdk::LockstepApi.new(env)
# Add your API key here
client.with_api_key({INSERT_API_KEY})
# Querying for the first 10 invoices sorted by invoice date
invoices = client.invoices.query_invoices(
pageSize: 100, # number of items per page
pageNumber: 0, # page number
filter: "invoiceDate GT 2021-01-10 AND invoiceDate LT 2021-05-10", # filter query
include_param: "Company", # includes extra fields
order: "invoiceDate asc" # ordering
)
puts invoices['records']
Lockstep provides example code on the Fetch Invoice Sample Ruby Project page.