Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for usage-based billing #55

Open
dcblogdev opened this issue Nov 9, 2023 · 2 comments
Open

Support for usage-based billing #55

dcblogdev opened this issue Nov 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dcblogdev
Copy link

Are there plans to add support for usage-based billing?

I'd like to use this for apps that will be paying for multiple seats, from what I understand the API needs the following on checkout:

"attributes": {
      "checkout_data": {
        "variant_quantities": [
          {
            "variant_id": 1,
            "quantity": 10
          }
        ]
      }
    },

then later up update the qty

PATCH https://api.lemonsqueezy.com/v1/subscription-items/1

{
  "data": {
    "type": "subscription-items",
    "id": "1",
    "attributes": {
      "quantity": 5
    }
  }
}
@driesvints
Copy link
Contributor

Yes definitely. Just need to find time to work on it. Any pr that kickstarts it is greatly appreciated.

@driesvints driesvints added the enhancement New feature or request label Nov 9, 2023
@driesvints
Copy link
Contributor

I realised last week when looking at the Lemon Squeezy API changes that this will require a new major release for the library. We'll need a new subscription_items table which holds all item records for subscriptions in a similar fashion like Cashier Stripe and Cashier Paddle. Then we'll need to rework parts of the library to accommodate for this. Finally, we'll need to add a migration path for people upgrading from v1 to v2, most likely using some sort of sync command for subscriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants