Authentication

Bias authenticates each API request with a secret API key, and the key determines which environment the request acts on. Sandbox keys start with sk_test_ and act only on their sandbox. Live keys start with sk_live_.

Note

A secret key has full access to its environment. Keep it on your server and out of source control.

Create an API key

  1. In the environment selector in the dashboard sidebar, choose the sandbox or live environment.
  2. Go to Developers → API keys and click Create API key.
  3. Enter a Name and click Create.
  4. Copy the key. You can only view it once.
The Create secret key dialog on the Developers API keys page

Authenticate requests

Send the key in the Authorization header as a bearer token:

curl https://api.biaspay.com/v1/customers \
  -H "Authorization: Bearer $BIAS_API_KEY"

The SDKs take the key when you create the client.

const bias = new Bias({ apiKey: process.env.BIAS_API_KEY! });
const customers = await bias.customers.list();