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

Wiki createDiscount function missing isLimitedToProducts option #136

Open
felixranesberger opened this issue Dec 3, 2024 · 0 comments
Open

Comments

@felixranesberger
Copy link

Hi! I just created a discount using the wiki page: https://github.com/lmsqueezy/lemonsqueezy.js/wiki/Discounts#usage

I found that the discount was not limited to certain products, as the variantIds configuration option would suggest.
When adding isLimitedToProducts: true it works fine.
It should probably be also listed in the example, since most users would expect the coupon to be limited, when variantIds are provided.

Current

const { statusCode, error, data } = await createDiscount({
	name: 'TestDiscount',
	amount: 50,
	amountType: 'percent',
	storeId: 123456,
	variantIds: [345678, 456789],
});

Proposed

const { statusCode, error, data } = await createDiscount({
	name: 'TestDiscount',
	amount: 50,
	amountType: 'percent',
	storeId: 123456,
	variantIds: [345678, 456789],
	isLimitedToProducts: true,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant