NuroDev / lemonsqueezy.ts

🍋 JavaScript / TypeScript SDK for the Lemon Squeezy API
https://paka.dev/npm/lemonsqueezy.ts
MIT License
159 stars 16 forks source link

400 bad request when trying to `updateSubscription` #14

Open developeratul opened 1 year ago

developeratul commented 1 year ago

When I am trying to update a subscription in this way,

await client.updateSubscription({
  id: user.subscriptionId,
  variantId: `${user.variantId}`,
  productId: process.env.LEMONS_SQUEEZY_PRODUCT_ID as string,
  cancelled: true,
});

I am getting 400 bad request as a response. The client is set up properly using valid API keys and is certain that all the values being used in the object are also valid.

What is causing this issue? and let me know if it requires more information and context.

Pardon my mistakes. I am writing an actual GitHub issue for the first time ;)

Parth971 commented 1 year ago

Please send response whenever writing for errors.

developeratul commented 1 year ago

The response only contains a status code of 400 and a message of Bad request. Nothing else.