Authentication
The Bias API uses API Keys to secure requests. You can view and manage API keys in the Bias Dashboard.
Sandbox keys are prefixed with sk_test_
and live keys with sk_live_
. Use sandbox keys and environments for testing and the live environment for your production application.
Creating an API key
Navigate to the API keys page in the Bias Dashboard. Ensure the correct environment is selected in top left corner. Click Create API key. Once your key is created, you will not be able to see it again. Store your key in a secure location, rotating it regularly. Use environment variables or secrets managers to avoid committing your key to source control.
Examples
Use the header authorization: Bearer <key>
to authenticate requests:
Shell
curl https://api.biaspay.com/v1/customers \
-H "Authorization: Bearer sk_test_yydvNDuNmnjOt1kBVJAU2MCTm2sxMQkdRLy6Kbxx"
When using the SDK, supply the API key when constructing the client.
TypeScript
const bias = new Bias({
apiKey: 'sk_test_yydvNDuNmnjOt1kBVJAU2MCTm2sxMQkdRLy6Kbxx',
});
const customers = await bias.customers.list();