Loading Settler...
Loading Settler...
Loading documentation...
Ruby SDK with idiomatic Ruby patterns and full API coverage.
Follows Ruby best practices
Available as Ruby gem
Comprehensive error classes
Complete API coverage
Install using gem
gem install settler-sdk
# or add to Gemfile
gem 'settler-sdk'Review the package quickstart
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']}"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