Encountering Error 429 when creating customer accounts

Highlighted
Tourist
12 0 1

Hey all,

 

This is something that we've been encountering for a while but haven't found a fix for yet. We've implemented a site which may make multiple API calls, both using Shopify's built in API and our own external ones as well, however, we always encounter the Status Code 429: Too Many Requests when trying to create new customer accounts on our site.

 

We think that it's perhaps related to Ajax; when the submit button is called we use event.preventDefault() to handle the success in our own way. It works maybe once a day on each of our machines before trying to create further accounts results in the aforementioned 429, but I can't see how that alone is triggering multiple API calls resulting in too many requests. Does anyone have any idea why this is behaving like this?

 

Is there a way to get past this or to build a workaround? Any suggestions are thoroughly appreciated, thanks!

0 Likes
Highlighted
Shopify Expert
9856 98 1678

Can you share the flow on _how_ you are creating customers?

It sounds like you're doing that via AJAX so is this some attempt to push it via the front end forms, or via the API. Both are going to run into different issues so some back story will help.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
New Member
4 0 0

Hi Jason,

 

I'm having the same issue. We use Ajax to register and login users from the frontend like the following:

 

$.ajax({
          type: "POST",
          url:'/account',
          data: $this.serialize(),
          success: function success(data) {
           // some code here
          },
          error: function error(xhr, ajaxOptions, thrownError) {
            console.log(thrownError);
           // some code here
          }
    });

It seems to always give us a 429 error "Too Many Requests."

Note this used to work in the past but somehow it stopped working.

 

Any help will be appreciated!

Cristina

0 Likes
Highlighted
Tourist
12 0 1

Hi Cristina, I'm not sure how much this will help but we discovered that attempting to use e.preventDefault to prevent the API from doing what it was originally meant to do was resulting in the error 429 (we were trying to redirect to to a different page after registration/login).

 

When we removed the preventDefault, it began taking us to the captcha, which would then allow us to continue working as normal. We had to place several workarounds to get it working the way we originally intended, but this is the only way we could think of now.

1 Like
Highlighted
New Member
4 0 0

Thank you Ricardo. I'll give it a try :)

0 Likes
Highlighted
New Member
4 0 0

Hi Ricardo,

 

This worked, so many thanks.

 

On another note, if you ask Shopify they will get rid of the CHAPTA step for you.

 

Regards,

Cristina

0 Likes