Guides

Rate limiting

The Puntjes API enforces two types of limits: rate limits (requests per minute) and plan limits (what the vendor's plan includes). Only the transaction allowance is monthly; the rest are standing ceilings that do not reset.


Rate limits

Each vendor's billing plan defines a maximum number of API requests per minute (rate_limit_per_minute). When this limit is exceeded, the API returns:

HTTP 429 Too Many Requests

Every response carries X-RateLimit-Limit and X-RateLimit-Remaining, so you can read your allowance without exhausting it first.

The count is kept per vendor. Your plan's number is the whole allowance, so a second set of credentials does not buy a second window: a till and a webshop on one account spend the same one, and a runaway integration throttles your others with it. It is not keyed on the calling address, so colleagues behind a single office connection never share an allowance with another vendor.

Refused requests count too

The limiter runs ahead of the account checks, so a request with a valid token still spends one of your requests when it fails: a 404, a 422 or a 403 SUBSCRIPTION_EXPIRED counts like a 200. A request with a bad token, or from an account the API refuses, counts against the smaller allowance per address described below. A wrong client_secret counts against the token limit.

This changes how you debug a new integration. A retry loop against a bad credential reaches 429, and that 429 tells you nothing about the credential. It only means you asked too often. Fix the secret; do not read the throttle as a second clue.

Requests with no valid vendor

When a credential resolves to no account that may use the API, the request is counted against a separate and much smaller allowance, keyed on the calling address instead of the vendor. There is no vendor to key on when the token cannot be read. Three cases land here: a missing or invalid bearer token, a client that is not linked to a vendor, and an account whose status refuses access.

Your plan's allowance is untouched by that counter. The two are separate, so someone probing your address with bad tokens cannot spend the requests you pay for.

The partner API

POST /api/v1/partner/clients has its own limit, apart from every vendor's plan: 30 calls a minute per partner client. A call with no valid token counts per calling address, also 30 a minute. See Partner integrations.

POST /api/v1/client/secret and DELETE /api/v1/client share one limit, also apart from the plan: 10 calls a minute per client for the two together. A call with no valid token counts per calling address, also 10 a minute. A call that fails, for example with a wrong client_secret, spends one of the 10. See Partner endpoints.

Token requests

POST /oauth/token has its own limit, apart from every vendor's plan. It counts in two ways:

  • 60 requests a minute for each client ID from one IP address. The client ID is the client_id in the request body. When the body has no client_id, it is the user name of HTTP Basic authentication.
  • 600 requests a minute for each IP address, for all client IDs together. A request without a client ID counts only here.

A request that fails, for example with a wrong client_secret, also counts. When you go past a limit, the API answers 429 with the error code RATE_LIMITED. The Retry-After header gives the number of seconds to wait.

Handling rate limits

When you receive a 429 response:

  1. Wait before retrying: implement exponential backoff
  2. Review your integration's request patterns
  3. Consider caching responses where appropriate (e.g., reward lists, campaign lists)

Plan usage limits

Each billing plan sets these ceilings. Zero means unlimited on every max_ ceiling. rate_limit_per_minute is at least 1.

LimitResetsDescription
max_transactionsMonthlyTransactions per billing period
max_customersNeverCustomers the vendor may hold in total
max_rewardsNeverRewards the vendor may hold, inactive ones too
max_campaignsNeverCampaigns the vendor may hold
max_locationsNeverBranches the vendor may hold
rate_limit_per_minutePer minuteAPI requests per minute

Only the transaction allowance resets. A POST /customers refused because the plan's customer ceiling is reached will still be refused next month. The vendor has to upgrade or delete a customer. Retrying it later is not a fix.

That refusal is a 422 VALIDATION_ERROR, not a 429. The 429 PLAN_LIMIT_EXCEEDED code is reserved for the transaction meter, because it is the only ceiling whose refusal clears with time.

When the transactions of the plan are used

After the vendor has used the transactions its plan includes for the period, the API can refuse new transactions with:

{
    "error": {
        "code": "PLAN_LIMIT_EXCEEDED",
        "message": "Transaction limit exceeded for your subscription plan.",
        "status": 429
    }
}

Feature flags

Some features are controlled by the billing plan:

CapabilityDescription
CampaignsWhether the vendor can create and use campaigns
Customer moment campaignsWhether those campaigns may be birthday, anniversary or win-back gifts, or only point multipliers
Point expirationWhether the vendor can enable point expiration

If a feature is not included in the plan, attempting to use it returns an error.


Checking usage

The Usage page in the admin portal shows the current period: transactions recorded, the allowance the plan includes, whether that allowance is spent, and the last day of the period.

The API reports none of that. There is no usage endpoint and no remaining-allowance header, so an integration still learns its allowance is gone from a 429 PLAN_LIMIT_EXCEEDED on a POST /transactions: a response that does not clear by waiting inside the period. Write that branch anyway; see Error handling.

Plan upgrades

If your integration consistently hits plan limits, contact your Puntjes administrator to upgrade to a plan with higher limits.