Appearance
API Keys
Rexel APIs are RESTful and return JSON. You can use them in two modes, Test and Live, each with its own keys. Test vs live is chosen by the key, not the URL.
Key types
| Key | Prefix | Use |
|---|---|---|
| Public key | pk_test_ / pk_live_ | Used with the secret key to generate a basic token (SDK / pop-up / redirect) |
| Secret key | sk_test_ / sk_live_ | Authorizes every API call. Server-side only |
Keep secret keys secret
Never put secret keys in client code, mobile apps, public repos or forums. Store them in environment variables or a vault, and rotate them periodically.
Toggle Test and Live mode
- Log in to the Rexel Dashboard.
- Go to Developers > Configuration (bottom of the left nav).
- Use the top-right toggle to pick Test or Live mode.
Get your keys
- In Developers > Configuration, open the API Keys tab.
- Click the reveal button next to each key.
Reset keys
If a key leaks, click Reset both keys. Old keys stop working at once and new ones are generated.
Authentication
All requests must use HTTPS and carry your secret key in the X-Api header.
bash
curl https://laas.rexel.ng/api/payment/payment-link \
-H "X-Api: sk_test_xxxxxxxxxxxxxxxx"The API uses GET, POST and PUT. See each endpoint in the API Reference.