Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Create Checkout URL gives 500 server error #17

Open

Description

@Parth971

Hi I've been using leamonsqeezy payment gateway since few days.

I found one Bug/Error in create checkout API.

Senario: I want to pre-feel checkout form with discount-code and other details.

I am able to do it with documentation, but during one case It returned 500 server error, so I thought you might be able help me.

I am hitting "https://api.lemonsqueezy.com/v1/checkouts", with some data (attached image). Now for this to work, I need to have dicount created in dashboard. So I created a discount by filling name, code, price, and remaining as it is; then it works as expected, but while creating discount if I manually select all product under "Discount applies to specific products?" dropdown, then checkout url is giving error which is not specified anywhere, and error message is also not making any sense.

Json data for Create Checkout URl:
Screenshot from 2023-06-22 16-59-47

Response:
status_code: 500
json: {'message': 'An unexpected error occurred.', 'event_id': {}}

please do let me know if this is issue from your end or I am doing something wrong. To note, I am doing this code in test mode.

Activity

  1. samyhajar commented on Aug 14, 2023

    @samyhajar

    Hi,
    i fell on the same error, but have a hard time to solve the issue.
    Did you solve it?
    if yes, could you share maybe your solution?
    Thank you!

  2. Parth971 commented on Aug 14, 2023

    @Parth971
    Author

    Not yet. For the time being, I preferred to use discount by passing in JSON data itself instead of selecting from the dashboard.

  3. samyhajar commented on Aug 14, 2023

    @samyhajar

    Thank you!

  4. samyhajar commented on Aug 17, 2023

    @samyhajar

    Just for info,
    Lemon Squeezy seemed to have resolved the issue.
    Try again @Parth971.

  5. kchander commented on Dec 28, 2023

    @kchander

    Now Im getting this issue any lead on this?

  6. rohitdasu commented on Jan 13, 2024

    @rohitdasu

    Same issue came to me as well. I've changed nothing in the checkout code.

  7. Jaaneek commented on Feb 2, 2024

    @Jaaneek

    Im getting this issue as well

  8. proevilz commented on Feb 2, 2024

    @proevilz

    I'm experiencing this issue too. @samyhajar Any help?

  9. tonyljx commented on Apr 18, 2024

    @tonyljx

    I'm getting this issue as well. But FInally I found out

    We need to pass the userEmail or userName to make it work!

    If I do not pass the email or name, I will get 500, Hope It helps

    e.g

        const newCheckout: NewCheckout = {
          checkoutData: {
            email: user_email,  
            name: user.username || user_email,
            custom: {
              orderId: orderId,
            },
          },
          testMode: true,
        };
  10. tonyljx commented on Apr 18, 2024

    @tonyljx

    I'm getting this issue as well. But FInally I found out

    We need to pass the userEmail or userName to make it work!

    If I do not pass the email or name, I will get 500, Hope It helps

    e.g

        const newCheckout: NewCheckout = {
          checkoutData: {
            email: user_email,  
            name: user.username || user_email,
            custom: {
              orderId: orderId,
            },
          },
          testMode: true,
        };

    There may be another reason. I use edge to checkout once, but when i open the url in private mode, it works!

    So It may be correlated with the browser cookie

  11. Siddharth1India commented on Jun 3, 2024

    @Siddharth1India

    Same error I am facing, same code was working yesterday. Anything which can help?

  12. steinathan commented on Sep 17, 2024

    @steinathan

    Same error, i was working yersteday night

    EDIT:
    My variant id was invalid - it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions