InstafuelInstafuel
FREN
  • Guides
  • Référence
  • Référence API
Guides
  • Démarrage rapide
  • Clés d'API
  • Référence API
Référence
  • Codes d'erreur
  • Glossaire
  • English
Environnement
  • Staging — instafuel-backend-staging.up.railway.app

© Instafuel — Abidjan, Côte d'Ivoire

HomeQuickstartAuthenticationAPI keysBusiness introducerWallet creditErrors and idempotencyLimits and quotasScopeWebhooks
powered by Zudoku
Guides

Authentication

The partner API authenticates with an API key, sent as a header on every request. There is no login, no password, no token to refresh: the key is the only secret.

Code
Authorization: Bearer ifp_live_9f2c4a7b1e8d3406af5b2c9d1e0f7a83

No user login here

/v1/papi/* is a machine API, meant for your server. Your clients' human accounts (fleet manager, finance director) sign in to the Instafuel dashboard with their own password — that journey does not go through this API and is not documented here.

An authenticated call

curl "https://instafuel-backend-staging.up.railway.app/v1/papi/me" \ -H "Authorization: Bearer $INSTAFUEL_API_KEY"
{ "ref": "APP-7C3D91B0", "name": "Ivoire Fleet Partners", "email": "contact@ivoirefleet.ci", "environment": "test", "companiesCount": 12, "walletCreditEnabled": true, "scopes": [ "COMPANIES_READ", "TRANSACTIONS_READ", "WALLET_READ", "COMPANIES_WRITE", "CREDIT_REQUEST_WRITE", "REPORTS_READ" ], "caps": { "perOperationFcfa": 5000000, "dailyFcfa": 20000000, "dailyRemainingFcfa": 14500000 } }

GET /v1/papi/me is the right health check: it changes nothing, costs little, and tells you exactly what the key allows.

The two prefixes

PrefixEnvironmentBase URLEffect
ifp_test_*staginghttps://instafuel-backend-staging.up.railway.apptest data, no real money
ifp_live_*productionprovided with the keyreal money

The prefix is part of the key: you read it, you do not guess it. A test key presented against production is rejected with 401, and vice versa — the two environments share no data.

That separation gives you a control which is easy to automate: if your test code holds a key that does not start with ifp_test_, stop before the call.

Code
if ( process.env.NODE_ENV !== "production" && !process.env.INSTAFUEL_API_KEY.startsWith("ifp_test_") ) { throw new Error("Production key detected outside production — aborting."); }
Code
import os api_key = os.environ["INSTAFUEL_API_KEY"] if os.environ.get("APP_ENV") != "production" and not api_key.startswith("ifp_test_"): raise SystemExit("Production key detected outside production — aborting.")

Where the key belongs

An API key never lives on the client side

It grants access to your entire portfolio. It belongs in an environment variable or a secret manager, on your server. Never in a Git repository, never in a browser JavaScript bundle, never in a mobile app — even "obfuscated", it is extractable in minutes.

If your web interface must display portfolio data, route it through your own backend: that backend holds the key and applies your own access rules.

Authentication errors

HTTPerror.codeCauseWhat to do
401PAPI_KEY_MISSINGAuthorization header absentadd the header
401PAPI_KEY_INVALIDunknown key, revoked, or wrong environmentcheck the prefix and the base URL
401PAPI_KEY_EXPIREDkey past its expiryissue a new one, see API keys
403PAPI_IP_FORBIDDENcalling address not in the allow listadd your server's outbound IP
403PAPI_SCOPE_MISSINGthe key lacks the scope this operation needsuse a key carrying it
403RESELLER_INACTIVEintroducer account disabledcontact Instafuel

A key revoked after a botched rotation gives this — that is the trace to look for when an integration goes dark at once:

{ "error": { "code": "PAPI_KEY_INVALID", "message": "Clé d'API inconnue ou révoquée" } }

A valid key missing the required scope:

{ "error": { "code": "PAPI_SCOPE_MISSING", "message": "Cette clé ne porte pas le droit CREDIT_REQUEST_WRITE", "requiredScope": "CREDIT_REQUEST_WRITE" } }

Branch on error.code, never on message — see Errors and idempotency.

What the key determines

The key carries your identity and your scope. You do not pick which company you call for: you call, and the server narrows the answer to your portfolio. No parameter widens that view — see Scope.

It also carries its scopes: a read-only key returns 403 PAPI_SCOPE_MISSING on any write, with no side effect.

Last modified on September 2, 2026
QuickstartAPI keys
On this page
  • An authenticated call
  • The two prefixes
  • Where the key belongs
  • Authentication errors
  • What the key determines
Javascript
PHP
JSON
Javascript
JSON
JSON