Halal Eats

Errors and limits

Understand pagination, nearby search limits, status codes, and error response bodies.

This page covers the predictable behavior clients should rely on.

Pagination

Restaurant list responses include pagination metadata:

type PaginationMeta = {
  page: number;
  limit: number;
  total: number;
  totalPages: number;
};

Defaults and limits:

ValueLimit
Default page1
Default list limit20
Maximum list limit100

Nearby search limits

ValueLimit
Default radius5000 meters
Maximum radius50000 meters
Default result limit20
Maximum result limit100

Invalid coordinates return a validation error.

Error body

Errors use this shape:

type ApiErrorBody = {
  error: string;
  code: string;
};

Example:

{
  "error": "Store not found",
  "code": "NOT_FOUND"
}

Common status codes

StatusMeaning
400Validation error
401Missing or invalid API key
403API key does not have access
404Resource not found
409Duplicate or conflicting submission
500Unexpected server error

SDK errors

The SDK converts failed responses into HalalEatsError:

try {
  await client.stores.get("missing-id");
} catch (error) {
  if (error instanceof HalalEatsError) {
    console.log(error.status);
    console.log(error.code);
    console.log(error.body);
  }
}

Caching

Public read endpoints may send cache headers. Clients should still handle stale or unavailable data gracefully.

On this page