Error 429 - Too Many Requests

SilvanSilvan Member Posts: 4
I've tried to retrieve all orders of a given month, not realising that the large quantity (4 million) of requests can trigger a database protection response to this.

Now all request are blocked (blacklisted?)

It would be nice to retrieve all orders within a set time period in 1 call.

Anyway, I would like to know what this error implies systematically. Am I blacklisted, locked out for xxx minutes?
Tags:

4 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 569 moderator
    Hey @Silvan

    Every modern API has some of kind of rate limiting since every request has a cost.

    A 429 error is simply a signal to inform you that you have made too many requests during a given period. 

    You can read this on our documentation here: https://developers.lightspeedhq.com/ecom/introduction/errors/

    The default rate limits are set at
    A maximum of 300 requests every 5 minutes,
    A maximum of 3000 requests every hour
    A maximum of 12000 requests every 24 hours
     
    With every request you'll receive a response which includes the following headers:

    X-RateLimit-Remaining

    The rate limit remaining

    X-RateLimit-Reset
    The time it takes for the rate limit to reset to total capacity (at 300 or 3000 or 12000)

    Simply get your code to read the headers and then cause your code to sleep for periods of time

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • beezwingsbeezwings Member Posts: 1

    I am using the sync tool for Woocommerce to Lightspeed, and I have been trying to sync products one at a time and I'm getting the 429 error even though I hadn't made a request for the last 20 hours. Any idea why this might be happening?

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 569 moderator

    Hey @beezwings,

    It's hard to tell what's happening behind the scenes. My advice would be to contact the developer and they might be able to provide more insight into your situation.

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.