This is a ruby wrapper for Lago API
Install the gem and add to the application's Gemfile by executing:
$ bundle add lago-ruby-client
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install lago-ruby-client
require 'lago-ruby-client'
client = Lago::Api::Client.new({api_key: 'key'})
event = {
transaction_id: "__UNIQUE_ID__",
customer_id: "5eb02857-a71e-4ea2-bcf9-57d8885990ba",
code: "code",
timestamp: 1650893379,
properties: {
custom_field: "custom"
}
}
client.events.create(event)
customer = {
customer_id: "5eb02857-a71e-4ea2-bcf9-57d8885990ba",
address_line1: nil,
address_line2: nil,
city: nil,
country: nil,
email: "[email protected]",
legal_name: nil,
legal_number: nil,
logo_url: nil,
name: "test name",
phone: nil,
state: nil,
url: nil,
vat_rate: nil,
zipcode: nil
}
client.customers.create(customer)
subscription = {
customer_id: "5eb02857-a71e-4ea2-bcf9-57d8885990ba",
plan_code: "code"
}
client.subscriptions.create(subscription)
params_delete = {
customer_id: "5eb02857-a71e-4ea2-bcf9-57d8885990ba"
}
client.subscriptions.delete(params_delete)
applied_coupon = {
customer_id: "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
coupon_code: "code",
amount_cents: 123,
amount_currency: "EUR"
}
client.applied_coupons.create(applied_coupon)
applied_add_on = {
customer_id: "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
add_on_code: "code",
amount_cents: 123,
amount_currency: "EUR"
}
client.applied_add_ons.create(applied_add_on)
bundle install
bundle exec rspec
The Lago documentation is available at doc.getlago.com.
The contribution documentation is available here
Lago Ruby client is distributed under AGPL-3.0.