Docs
Authorization

Authorization

The Splice Payment API uses Basic Authentication for all endpoints.

To authenticate your requests, you need to include an Authorization header with a Base64-encoded string of your username and password.

How to Perform Basic Authentication

  1. Encode your credentials: Combine your username and password into a single string with a colon separating them (username:password).
  2. Encode this string using Base64.
  3. Add the Authorization header: Include an Authorization header in your HTTP request with the value Basic {base64encoded_credentials}.
Example of Basic Auth Header
Authorization: Basic Base64Encode(username:password)

Here's how you can generate the Base64-encoded string in a few programming languages:

Python

Encoding to base64 in Python
import base64
 
credentials = 'username:password'
encoded_credentials = base64.b64encode(credentials.encode('utf-8')).decode('utf-8')
print(f'Basic {encoded_credentials}')

JavaScript

Encoding to base64 in JS
const credentials = 'username:password';
const encodedCredentials = btoa(credentials);
console.log(`Basic ${encodedCredentials}`);

Using Authentication in API Requests

Once you have your encoded credentials, include them in the Authorization header of your API requests. Here's an example using cURL to get all financial institutions:

curl --request GET \
  --url https://sandbox.splice.africa/institutions \
  --header 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmA='

Next steps

You may proceed to the next section learn more about how we use webhooks for payment notifications.

Or you can start interacting with our sandbox and exploring the rest of the endpoints here: API Reference

If you have any questions, you can reach out to us on email support@splice.africa or join our Discord server. We are always online and happy to help.