Best Practices
Recommended patterns for building robust and performant integrations with STEF APIs.
Recommended patterns for building robust and performant integrations with STEF APIs.
Respect the rate limiting headers returned by the API:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum number of requests per window |
X-RateLimit-Remaining | Remaining requests in the current window |
X-RateLimit-Reset | Window reset timestamp |
Retry-After | Seconds to wait (if 429) |
Use environment variables or a secrets manager:
# .env
STEF_CLIENT_ID=your_client_id
STEF_CLIENT_SECRET=your_client_secret
# .gitignore
.env
Cache-Control and ETag headersIf-None-Match, If-Modified-Since)limit) to the strict minimumEnable gzip compression in your requests:
curl -X GET "https://api.stef.com/v1/transport/orders" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept-Encoding: gzip"