Skip to content

Best Practices

Implementation checklist

Security

  • API Key stored in environment variables, never in code
  • All calls from backend, never from frontend
  • HTTPS required for callbacks

Robustness

  • Always verify status with GET /status after callback
  • Implement retries with exponential backoff
  • Handle all HTTP error codes
  • Store accessToken in case you need it

Connectivity & Monitoring

  • Use GET /v1/health on application startup to verify API connectivity
  • Implement periodic health checks to monitor API availability
  • Compare server timestamp to detect clock drift issues

Operation Management

  • Use externalId consistently when creating operations
  • Use GET /v1/operations/by-external-id/{externalId} to sync with your booking system
  • Consider externalId as your primary reference (no need to store Fliinow IDs)

HTTP Caching (ETags)

  • Store the ETag header from operation responses
  • Include If-None-Match: "{etag}" header in subsequent requests
  • Handle 304 Not Modified responses (use cached data, saves bandwidth)
  • Ideal for status polling - reduces server load and speeds up responses

User Experience

  • Clearly show APR and total to pay
  • Indicate redirect is to a secure site
  • Have friendly error page for rejections
  • Use custom callback URLs (successCallbackUrl, errorCallbackUrl) to keep customers on your brand experience

Data

  • Use externalId you can link to your system
  • Dates in dd-MM-yyyy format in body
  • Dates in yyyy-MM-dd format in query params

API Key Security

Protect your credentials by following these essential practices

Use environment variables

Never hardcode your API Key in source code. Use environment variables (.env) or secret managers like AWS Secrets Manager, HashiCorp Vault, or Azure Key Vault.

Server-side calls only

Never expose your API Key in frontend code (browser JavaScript, mobile apps). All requests must originate from your server.

Rotate your keys regularly

Change your API Keys regularly (every 90 days recommended). If you suspect a key has been compromised, request a new one immediately.

Principle of least privilege

Use different API Keys for different environments (development, staging, production). Never use production keys in development.

Monitor usage

Regularly review the Fliinow dashboard to detect unusual usage patterns that may indicate a credential leak.

Protect your repository

Add .env and sensitive configuration files to .gitignore. Use tools like git-secrets to prevent accidental credential commits.

What to do if your API Key leaks?

  • 1. Contact support@fliinow.com immediately
  • 2. Request revocation and issuance of a new key
  • 3. Update the new key in all your environments
  • 4. Review logs to detect unauthorized use
  • 5. Implement additional measures to prevent future leaks

ETag Flow Example

How conditional requests work with ETags

1

First request → Get response + ETag header

→ ETag: "PENDING-1706789000"
2

Second request with If-None-Match header

If-None-Match: "PENDING-1706789000"
→

If unchanged → 304 Not Modified (no body, use cache). If changed → 200 OK with new data + new ETag