{"id":13877880,"url":"https://github.com/deanpcmad/lemonsqueezy","last_synced_at":"2026-03-06T22:04:50.068Z","repository":{"id":60665784,"uuid":"544601283","full_name":"deanpcmad/lemonsqueezy","owner":"deanpcmad","description":"Ruby library for the Lemon Squeezy API","archived":false,"fork":false,"pushed_at":"2025-03-26T15:53:18.000Z","size":130,"stargazers_count":37,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T10:29:46.592Z","etag":null,"topics":["lemon-squeezy","lemonsqueezy","ruby","rubygem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deanpcmad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"buy_me_a_coffee":"deanpcmad"}},"created_at":"2022-10-02T21:52:23.000Z","updated_at":"2025-09-30T14:22:40.000Z","dependencies_parsed_at":"2024-11-01T11:01:58.706Z","dependency_job_id":"112ea2b2-53de-4b7a-b5a1-0fcff4cbcfd7","html_url":"https://github.com/deanpcmad/lemonsqueezy","commit_stats":{"total_commits":69,"total_committers":3,"mean_commits":23.0,"dds":0.04347826086956519,"last_synced_commit":"8c26864d45b3cbd02757c1346c47c60e71c753db"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/deanpcmad/lemonsqueezy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanpcmad%2Flemonsqueezy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanpcmad%2Flemonsqueezy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanpcmad%2Flemonsqueezy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanpcmad%2Flemonsqueezy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deanpcmad","download_url":"https://codeload.github.com/deanpcmad/lemonsqueezy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanpcmad%2Flemonsqueezy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30200756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lemon-squeezy","lemonsqueezy","ruby","rubygem"],"created_at":"2024-08-06T08:01:33.868Z","updated_at":"2026-03-06T22:04:45.057Z","avatar_url":"https://github.com/deanpcmad.png","language":"Ruby","funding_links":["https://buymeacoffee.com/deanpcmad"],"categories":["Ruby"],"sub_categories":[],"readme":"# LemonSqueezy Ruby Library\n\nA Ruby library for the Lemon Squeezy API.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"lemonsqueezy\", \"~\u003e 1.0\"\n```\n\n## Usage\n\n### Set API Key\n\nFirstly you'll need to create an API Key on your [settings page](https://app.lemonsqueezy.com/settings/api).\n\n```ruby\nLemonSqueezy.configure do |config|\n  config.api_key = ENV[\"LEMON_SQUEEZY_API_KEY\"]\n  config.default_page_size = 10 # Optional: Set default page size for paginated requests\nend\n```\n\n### User\n\n```ruby\n# Retrieve the authenticated user\nLemonSqueezy::User.me\n```\n\n### Stores\n\n```ruby\n# Retrieves a list of Stores\nLemonSqueezy::Store.list\n\n# Retrieves a Store\nLemonSqueezy::Store.retrieve id: 123\n```\n\n### Customers\n\n```ruby\n# Retrieves a list of Customers\nLemonSqueezy::Customer.list\n\n# Retrieves a list of Customers for a store\nLemonSqueezy::Customer.list store_id: 123\n\n# Retrieves a list of Customers that contain the supplied email\nLemonSqueezy::Customer.list email: \"test@hello.com\"\n\n# Retrieves a Customer\nLemonSqueezy::Customer.retrieve id: 123\n\n# Create a customer\n# https://docs.lemonsqueezy.com/api/customers#create-a-customer\nLemonSqueezy::Customer.create store_id: 123, name: \"Customer name\", email: \"test@hello.com\"\n\n# Update a customer\n# https://docs.lemonsqueezy.com/api/customers#update-a-customer\nLemonSqueezy::Customer.update id: 123, name: \"Customer name\", status: \"archived\"\n```\n\n### Products\n\n```ruby\n# Retrieves a list of Products\nLemonSqueezy::Product.list\n\n# Retrieves a list of Products for a specified Store\nLemonSqueezy::Product.list store_id: 123\n\n# Retrieves a Product\nLemonSqueezy::Product.retrieve id: 123\n```\n\n### Product Variants\n\n```ruby\n# Retrieves a list of Variants\nLemonSqueezy::Variant.list\n\n# Retrieves a list of Variants for a Product\nLemonSqueezy::Variant.list product_id: 123\n\n# Retrieves a Variant\nLemonSqueezy::Variant.retrieve id: 123\n```\n\n### Prices\n\n```ruby\n# Retrieves a list of Prices\nLemonSqueezy::Price.list\n\n# Retrieves a list of Prices for a Variant\nLemonSqueezy::Price.list variant_id: 123\n\n# Retrieves a Price\nLemonSqueezy::Price.retrieve id: 123\n```\n\n### Orders\n\n```ruby\n# Retrieves a list of Orders\nLemonSqueezy::Order.list\n\n# Retrieves a list of Orders for a specified store\nLemonSqueezy::Order.list product_id: 123\n\n# Retrieves a list of Orders for an email address\nLemonSqueezy::Order.list email: \"hello@test.com\"\n\n# Retrieves an Order\nLemonSqueezy::Order.retrieve id: 123\n\n# Retrieves the items on an Order\nLemonSqueezy::Order.retrieve order_items: 123\n```\n\n### Subscriptions\n\n```ruby\n# Retrieves a list of Subscriptions\nLemonSqueezy::Subscription.list\n\n# Retrieves a list of Subscriptions for a store\nLemonSqueezy::Subscription.list store_id: 123\n\n# Retrieves a list of Subscriptions for an Order\nLemonSqueezy::Subscription.list order_id: 123\n\n# Retrieves a list of Subscriptions for a product\nLemonSqueezy::Subscription.list product_id: 123\n\n# Retrieves a Subscription\nLemonSqueezy::Subscription.retrieve id: 123\n\n# Updates a Subscription\n# https://docs.lemonsqueezy.com/api/subscriptions#update-a-subscription\nLemonSqueezy::Subscription.update id: 123, variant_id: 123\n\n# Pauses a Subscription\n# Kind should be void or free\n# resumes_at can be nil or an ISO-8601 formatted date-time string indicating\n# when the subscription will continue collecting payments.\nLemonSqueezy::Subscription.pause id: 123, kind: \"void\", resumes_at: nil\n\n# Un-Pause a Subscription\nLemonSqueezy::Subscription.unpause id: 123\n\n# Cancel a Subscription\nLemonSqueezy::Subscription.cancel id: 123\n\n# Un-Cancel a Subscription\nLemonSqueezy::Subscription.uncancel id: 123\n\n# Change the Plan for a Subscription\n# invoice_immediately and disable_prorations are optional and false by default.\nLemonSqueezy::Subscription.change_plan id: 123, plan_id: 111, variant_id: 111, invoice_immediately: false, disable_prorations: false\n```\n\n### Subscription Invoices\n\n```ruby\n# Retrieves a list of Subscription Invoices\nLemonSqueezy::SubscriptionInvoice.list\n\n# Retrieves a list of Subscription Invoices for a specified Store\nLemonSqueezy::SubscriptionInvoice.list store_id: 123\n\n# Retrieves a list of Subscription Invoices for a specified Subscription\nLemonSqueezy::SubscriptionInvoice.list subscription_id: 123\n\n# Retrieves a Subscription Invoice\nLemonSqueezy::SubscriptionInvoice.retrieve id: 123\n```\n\n### Subscription Items\n\n```ruby\n# Retrieves a list of Subscription Items\nLemonSqueezy::SubscriptionItem.list\n\n# Retrieves a list of Subscription Items for a specified Subscription\nLemonSqueezy::SubscriptionItem.list subscription_id: 123\n\n# Retrieves a Subscription Item\nLemonSqueezy::SubscriptionItem.retrieve id: 123\n\n# Updates a Subscription Item\n# https://docs.lemonsqueezy.com/api/subscription-items#update-a-subscription-item\nLemonSqueezy::SubscriptionItem.update id: 123, quantity: 2\n\n# Retrieve subscription item's current usage\n# Returns 404 if the product/variant does not have usage based billing enabled\n# https://docs.lemonsqueezy.com/api/subscription-items#retrieve-a-subscription-item-s-current-usage\nLemonSqueezy::SubscriptionItem.current_usage id: 123\n```\n\n### Discounts\n\n```ruby\n# Retrieves a list of Discounts\nLemonSqueezy::Discount.list\n\n# Retrieves a list of Discounts for a store\nLemonSqueezy::Discount.list store_id: 123\n\n# Retrieves a Discount\nLemonSqueezy::Discount.retrieve id: 123\n\n# Create a Discount\n# https://docs.lemonsqueezy.com/api/discounts#create-a-discount\nLemonSqueezy::Discount.create store_id: 123, name: \"20 Off\", code: \"20OFF\", amount: 20, amount_type: \"percent\"\n\n# Delete a Discount\nLemonSqueezy::Discount.delete id: 123\n```\n\n### Discount Redemptions\n\n```ruby\n# Retrieves a list of Discount Redemptions\nLemonSqueezy::DiscountRedemption.list\n\n# Retrieves a list of Discount Redemptions for a Discount\nLemonSqueezy::DiscountRedemption.list discount_id: 123\n\n# Retrieves a list of Discount Redemptions for a Order\nLemonSqueezy::DiscountRedemption.list order_id: 123\n\n# Retrieves a Discount Redemption\nLemonSqueezy::DiscountRedemption.retrieve id: 123\n```\n\n### Licenses\n\nThis API is used to manage licenses generated by Lemon Squeezy. [Docs](https://docs.lemonsqueezy.com/help/licensing/license-api)\n\n```ruby\n# Validate a license key\nLemonSqueezy::License.validate key: \"abc123-abc123-abc123\"\n\n# Activate a license key\n# Instance is a label to identify this activation\nLemonSqueezy::License.activate key: \"abc123-abc123-abc123\", instance: \"Activation 1\"\n\n# Deactivate a license key\n# Instance is the License Key Instance ID\nLemonSqueezy::License.deactivate key: \"abc123-abc123-abc123\", instance: \"abc123\"\n```\n\n### License Keys\n\n```ruby\n# Retrieves a list of License Keys\nLemonSqueezy::LicenseKey.list\n\n# Retrieves a list of License Keys for a store\nLemonSqueezy::LicenseKey.list store_id: 123\n\n# Retrieves a list of License Keys for an order\nLemonSqueezy::LicenseKey.list order_id: 123\n\n# Retrieves a License Key\nLemonSqueezy::LicenseKey.retrieve id: 123\n\n# Updates a License Key\n# https://docs.lemonsqueezy.com/api/license-keys#update-a-license-key\nLemonSqueezy::LicenseKey.update id: 123, activation_limit: 10, disabled: false\n```\n\n### License Key Instances\n\n```ruby\n# Retrieves a list of License Key Instances\nLemonSqueezy::LicenseKeyInstances.list\n\n# Retrieves a list of License Key Instances for a license key\nLemonSqueezy::LicenseKeyInstances.list license_key_id: 123\n\n# Retrieves a License Key Instance\nLemonSqueezy::LicenseKeyInstances.retrieve id: 123\n```\n\n### Files\n\n```ruby\n# Retrieves a list of Files\nLemonSqueezy::File.list\n\n# Retrieves a File\nLemonSqueezy::File.retrieve id: 123\n```\n\n### Checkouts\n\n```ruby\n# Retrieves a list of Checkouts\nLemonSqueezy::Checkout.list\n\n# Retrieves a list of Checkouts for a store\nLemonSqueezy::Checkout.list store_id: 123\n\n# Retrieves a list of Checkouts for a variant\nLemonSqueezy::Checkout.list variant_id: 123\n\n# Retrieves a Checkout\nLemonSqueezy::Checkout.retrieve id: 123\n\n# Creates a Checkout\n# View docs for more info: https://docs.lemonsqueezy.com/api/checkouts#create-a-checkout\n# store_id and variant_id are required\n# Any other parameters are send as \"attributes\" to the API\nLemonSqueezy::Checkout.create store_id: 123, variant_id: 321, custom_price: 500, product_options: {name: \"a test name\"}\n```\n\n### Webhooks\n\n```ruby\n# List all Webhooks\nLemonSqueezy::Webhook.list\n\n# List all Webhooks for a Store\nLemonSqueezy::Webhook.list store_id: 123\n\n# Retrieve a Webhook\nLemonSqueezy::Webhook.retrieve id: 123\n\n# Create a Webhook\n# https://docs.lemonsqueezy.com/api/webhooks#create-a-webhook\nLemonSqueezy::Webhook.create store_id: 123, url: \"\", secret: \"abc\", events: [\"order_created\"]\n\n# Update a Webhook\n# https://docs.lemonsqueezy.com/api/webhooks#update-a-webhook\nLemonSqueezy::Webhook.update id: 123, events: [\"order_created\", \"subscription_created\"]\n\n# Delete a Webhook\nLemonSqueezy::Webhook.delete id: 123\n```\n\n### Pagination\n\nAll list methods support pagination. You can control pagination in two ways:\n\n1. Using the default page size in configuration:\n```ruby\nLemonSqueezy.configure do |config|\n  config.default_page_size = 10 # This will be used for all list requests\nend\n```\n\n2. Using pagination parameters in individual requests:\n```ruby\n# Get first page with 20 items\ncustomers = LemonSqueezy::Customer.list(page: { size: 20, number: 1 })\n\n# Get next page\nnext_page_customers = LemonSqueezy::Customer.list(page: { size: 20, number: 2 })\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/deanpcmad/lemonsqueezy.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpcmad%2Flemonsqueezy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeanpcmad%2Flemonsqueezy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpcmad%2Flemonsqueezy/lists"}