Official SDK
Ruby 3.0+
Beta
Ruby SDK
Ruby SDK with idiomatic Ruby patterns and full API coverage.
Ruby Idioms
Follows Ruby best practices
Gem Support
Available as Ruby gem
Error Handling
Comprehensive error classes
Full Coverage
Complete API coverage
Installation
Install using gem
gem install settler-sdk
# or add to Gemfile
gem 'settler-sdk'Quick Start
Get started in 5 minutes
require 'settler'
# Initialize client
client = Settler::Client.new(api_key: 'sk_your_api_key')
# Create a reconciliation job
job = client.jobs.create(
name: 'Shopify-Stripe Reconciliation',
source: {
adapter: 'shopify',
config: {
api_key: ENV['SHOPIFY_API_KEY'],
shop: 'your-shop',
},
},
target: {
adapter: 'stripe',
config: {
api_key: ENV['STRIPE_SECRET_KEY'],
},
},
rules: {
matching: [
{ field: 'order_id', type: 'exact' },
{ field: 'amount', type: 'exact', tolerance: 0.01 },
],
},
)
# Run the job
execution = client.jobs.run(job['id'])
# Get report
report = client.reports.get(job['id'])
puts "Matched: #{report['summary']['matched']}"
puts "Unmatched: #{report['summary']['unmatched']}"Error Handling
Handle errors gracefully
require 'settler'
begin
job = client.jobs.create({...})
rescue Settler::ValidationError => e
puts "Validation error: #{e.message}"
puts "Field: #{e.field}"
rescue Settler::AuthError => e
puts "Authentication failed: #{e.message}"
rescue Settler::RateLimitError => e
puts "Rate limit exceeded. Retry after: #{e.retry_after}"
rescue Settler::NetworkError => e
puts "Network error: #{e.message}"
rescue Settler::Error => e
puts "Error: #{e.message}"
end