Authentication
To interact with the SmartpayGenie API, you'll need to authenticate your requests using API keys. These keys are generated in your SmartpayGenie developer portal.
API key authentication
const myHeaders = new Headers();
myHeaders.append("token", "TlAWiePV51isvfuRZEHuCOW1ZDBeDHep2rnosIXHRVGvMwyFTMJZUVCeIneQJJ0h");
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"customerId": "49438567-bc45-494c-b57d-80b41f193de7",
"currency": "kes",
"channel": "fiat"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://api.switch.tulupay.com/customer/add-account", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
}
Security considerations
By following these guidelines, you can ensure the security of your API interactions and protect sensitive data.