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

.Variants.List API is changed #20

Closed
Jannchie opened this issue Jan 25, 2024 · 6 comments
Closed

.Variants.List API is changed #20

Jannchie opened this issue Jan 25, 2024 · 6 comments

Comments

@Jannchie
Copy link

Thank you for making such a library.

I found that some of the interfaces have changed, for example the API for List Variants no longer parses the returned content correctly.
https://docs.lemonsqueezy.com/api/variants

Also, lemonsqueezy has added Price as an object to retrieve, which is not yet supported by the library.
https://docs.lemonsqueezy.com/api/prices#the-price-object

@AchoArnold
Copy link
Member

Hello @Jannchie
I've implemented the new Price API endpoints, I didn't see what was wrong with the variants API appart from the introduction of the TestMode: boolean field. Also did you notice any other changes to the API's?

@Jannchie
Copy link
Author

Jannchie commented Jan 26, 2024

Thanks for the quick reply.

I get an error when parsing with this API:

variants, _, err := client.Variants.List(ctx)

error message is:

"json: cannot unmarshal string into Go struct field VariantAttributes.data.attributes.price of type int"

Can't you reproduce the problem on your end?

@AchoArnold
Copy link
Member

Hello @Jannchie

I cannot reproduce the issue. Which version of this lemonsqueezy-go client are you using?

I checked the api response and the data.attriubtes.price is int instead of string https://docs.lemonsqueezy.com/api/variants

@Jannchie
Copy link
Author

Jannchie commented Jan 26, 2024

I'm using v1.1.0... Maybe the newly created price has a different type?

@AchoArnold
Copy link
Member

@Jannchie
I just saw the problem with a new price, I'll contact the LemonSqueezy team to fix it. Some prices have string and others have int I think it's up to the API team to fix this inconsitency.

@AchoArnold
Copy link
Member

Fixed in 8da1ed4

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

2 participants