Skip to content

Rate Limit ​

Overview ​

The Appmax API limits a single route: the order lookup, GET /v1/orders/{order_id}. The other routes have no request limit.

Limit ​

RouteLimitCounted per
GET /v1/orders/{order_id}100 requests per minutemerchant client_id

The window is sliding: on each request, the API counts the ones from the last 60 seconds. There is no full minute that resets the counter.

INFO

The limit exists to keep the platform stable, but it can be adjusted. If your integration needs a higher limit, reach out to our team.

Response when the limit is exceeded ​

The request gets HTTP 429:

http
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
json
{
  "message": "Too Many Requests"
}

WARNING

The response carries no rate limit headers (Retry-After, X-RateLimit-*). Pace control has to live in your integration.

Best practices ​

  1. Use webhooks to follow the order. Instead of querying the same order at short intervals (polling), receive status changes through webhooks and query the order only when you need its details.
  2. Control the pace on your side. Keep at most 100 order lookups per minute per client_id, spread across the minute.
  3. Implement retry with exponential backoff. On a 429, wait (1s, 2s, 4s, 8s...) and try again, with a maximum number of attempts.

Retry with backoff example ​

go
func requestWithRetry(client *http.Client, req *http.Request) (*http.Response, error) {
	maxRetries := 3

	for attempt := 0; attempt <= maxRetries; attempt++ {
		resp, err := client.Do(req)
		if err != nil {
			return nil, err
		}

		if resp.StatusCode != http.StatusTooManyRequests {
			return resp, nil
		}
		resp.Body.Close()

		wait := 1 << attempt // backoff: 1s, 2s, 4s

		log.Printf("Rate limited, retrying in %ds (attempt %d/%d)", wait, attempt+1, maxRetries)
		time.Sleep(time.Duration(wait) * time.Second)
	}

	return nil, fmt.Errorf("rate limit exceeded after %d retries", maxRetries)
}
javascript
async function requestWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status !== 429) {
      return response;
    }

    const wait = Math.pow(2, attempt);

    console.log(`Rate limited, retrying in ${wait}s (attempt ${attempt + 1}/${maxRetries})`);
    await new Promise(resolve => setTimeout(resolve, wait * 1000));
  }

  throw new Error(`Rate limit exceeded after ${maxRetries} retries`);
}
python
import time
import requests

def request_with_retry(method, url, max_retries=3, **kwargs):
    for attempt in range(max_retries + 1):
        response = requests.request(method, url, **kwargs)

        if response.status_code != 429:
            return response

        wait = 2 ** attempt

        print(f"Rate limited, retrying in {wait}s (attempt {attempt + 1}/{max_retries})")
        time.sleep(wait)

    raise Exception(f"Rate limit exceeded after {max_retries} retries")
php
function requestWithRetry(string $method, string $url, array $options, int $maxRetries = 3): Response
{
    $client = new \GuzzleHttp\Client();

    for ($attempt = 0; $attempt <= $maxRetries; $attempt++) {
        $response = $client->request($method, $url, $options + [
            'http_errors' => false,
        ]);

        if ($response->getStatusCode() !== 429) {
            return $response;
        }

        $wait = pow(2, $attempt);

        Log::warning("Rate limited, retrying in {$wait}s (attempt " . ($attempt + 1) . "/{$maxRetries})");
        sleep($wait);
    }

    throw new \Exception("Rate limit exceeded after {$maxRetries} retries");
}