API Keys

FOREN APIs are completely RESTful and all responses are returned in JSON. You can use the APIs in two modes, Test and Live, each with its own set of keys.


API Key Types

FOREN authenticates your API requests using your account's API keys. If you do not include your key when making an API request, the request will fail.

CredentialPrefixDescription
Public Keypk_test_ / pk_live_Used together with your secret key to generate your basic token.
Secret Keysk_test_ / sk_live_Authorizes all your API calls without restriction. Keep this confidential and only store it on your own servers.
🔒

Do not share your secret API keys in publicly accessible platforms such as GitHub, client-side code, or public forums.


How to Toggle from Test to Live


  1. Log in: Access your account on the FOREN Dashboard
  2. Locate Developer Settings: On the left navigation bar, scroll to the bottom and click Configuration under the Developers section.
  3. Switch Modes: On the top-right corner of the Configurations page, use the toggle switch to select Live Mode or Test Mode.

Obtaining Your API Keys

  1. Log in to your FOREN Dashboard
  2. Locate Developer Settings: On the left navigation bar, scroll to the bottom and click Configurations under the Developers section.
  3. Select the API Keys tab

Your public and secret keys are displayed here. Click the reveal button to reveal each key.

Resetting API Keys

If your API keys have been compromised, click Reset both keys. This invalidates your existing keys and generates new ones immediately.


Authentication

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. Requests without authentication will also fail.


Base URL:

We use one URL for both live and test environments. The only difference will be your API keys (Test or Live).

BaseURL: https://laas.foren.co


How to use the API:

Headers:

KeyValue
X-ApiYour secret key (sk_test_****** or sk_live_******)

Example request:

curl https://laas.foren.co/api/payment/payment-link \
  -H "X-Api: sk_test_0f1h622b2h06b9h9e97h6h91a17he4673d55g35"

HTTP Methods

The API uses GET, POST, and PUT methods depending on the endpoint. Refer to each endpoint's documentation for the required method.




API Essentials


Did this page help you?