---
title: "Best Practices"
description: "Best practices for robust and performant API integration"
url: "https://api-portal-suitelogi-quaext.stef.com/en/guides/best-practices"
image: "https://api-portal-suitelogi-quaext.stef.com/_og/d/c_Ocean.takumi,title_Best+Practices,description_Best+practices+for+robust+and+performant+API+integration,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM1NTk2ZTYifX19,p_Ii9lbi9ndWlkZXMvYmVzdC1wcmFjdGljZXMi,s_oEmcLyIYPxxIyRfz.png"
---

**Developer Portal**

-   [APIs](https://api-portal-suitelogi-quaext.stef.com/en/apis)
-   [Get Started](https://api-portal-suitelogi-quaext.stef.com/en/getting-started)
-   [Guides](https://api-portal-suitelogi-quaext.stef.com/en/guides)
-   [Support](https://api-portal-suitelogi-quaext.stef.com/en/support)

[FR](https://api-portal-suitelogi-quaext.stef.com/)|**[EN](https://api-portal-suitelogi-quaext.stef.com/en)**|[ES](https://api-portal-suitelogi-quaext.stef.com/es)|[IT](https://api-portal-suitelogi-quaext.stef.com/it)|[PT](https://api-portal-suitelogi-quaext.stef.com/pt)|[NL](https://api-portal-suitelogi-quaext.stef.com/nl)|[DE](https://api-portal-suitelogi-quaext.stef.com/de)

## Best Practices

Recommended patterns for building robust and performant integrations with STEF APIs.

## [Rate Limiting](#rate-limiting)

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)                 |

## [Security](#security)

### [Secret Storage](#secret-storage)

Never store your Client Secret or API Key directly in source code.

Use environment variables or a secrets manager:

```bash
# .env
STEF_CLIENT_ID=your_client_id
STEF_CLIENT_SECRET=your_client_secret
```

```bash
# .gitignore
.env
```

## [Performance](#performance)

### [Caching](#caching)

-   Cache responses from read endpoints that do not change frequently
-   Respect the `Cache-Control` and `ETag` headers
-   Use conditional requests (`If-None-Match`, `If-Modified-Since`)

### [Efficient Pagination](#efficient-pagination)

-   Use the cursor-based pagination provided by the API
-   Limit the number of items per page (`limit`) to the strict minimum
-   Avoid loading all pages at once

### [Compression](#compression)

Enable gzip compression in your requests:

```bash
curl -X GET "https://api.stef.com/v1/transport/orders" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept-Encoding: gzip"
```

## [Monitoring](#monitoring)

-   Log response times and return codes
-   Set up alerts on 4xx and 5xx errors
-   Monitor your quota consumption via the portal dashboard

#### [APIs](#apis)

-   [API Catalogue](https://api-portal-suitelogi-quaext.stef.com/en/apis)
-   [Getting Started Guide](https://api-portal-suitelogi-quaext.stef.com/en/getting-started)

#### [Developers](#developers)

-   [Documentation](https://api-portal-suitelogi-quaext.stef.com/en/guides)
-   [Best Practices](https://api-portal-suitelogi-quaext.stef.com/en/guides/best-practices)
-   [Portals](https://api-portal-suitelogi-quaext.stef.com/en/getting-started/instances)

#### [Support](#support)

-   [Technical Support](https://api-portal-suitelogi-quaext.stef.com/en/support)

#### [Languages](#languages)

-   [Français](https://api-portal-suitelogi-quaext.stef.com/)
-   [English](https://api-portal-suitelogi-quaext.stef.com/en)
-   [Español](https://api-portal-suitelogi-quaext.stef.com/es)
-   [Italiano](https://api-portal-suitelogi-quaext.stef.com/it)
-   [Português](https://api-portal-suitelogi-quaext.stef.com/pt)
-   [Nederlands](https://api-portal-suitelogi-quaext.stef.com/nl)
-   [Deutsch](https://api-portal-suitelogi-quaext.stef.com/de)

© 2026 STEF — All rights reserved

[Mentions légales](https://www.stef.com/mentions-legales) · [Politique de confidentialité](https://www.stef.com/politique-confidentialite)