Whitelist website for iframe checkout
curl --request POST \
--url https://checkout.beem.africa/v1/whitelist/add-to-list \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"website": "https://example.com"
}
'import requests
url = "https://checkout.beem.africa/v1/whitelist/add-to-list"
payload = { "website": "https://example.com" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({website: 'https://example.com'})
};
fetch('https://checkout.beem.africa/v1/whitelist/add-to-list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://checkout.beem.africa/v1/whitelist/add-to-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'website' => 'https://example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://checkout.beem.africa/v1/whitelist/add-to-list"
payload := strings.NewReader("{\n \"website\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://checkout.beem.africa/v1/whitelist/add-to-list")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"website\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://checkout.beem.africa/v1/whitelist/add-to-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"website\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "successful"
}{
"status": 400,
"message": "\"website\" is required"
}{
"code": 120,
"message": "Invalid Authentication Parameters"
}{
"status": 403,
"message": "Please make sure your using a secured connection i.e https"
}API Reference
Whitelist website for iframe checkout
Whitelist your website domain before embedding the Beem checkout library. Only HTTPS origins are accepted.
POST
/
whitelist
/
add-to-list
Whitelist website for iframe checkout
curl --request POST \
--url https://checkout.beem.africa/v1/whitelist/add-to-list \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"website": "https://example.com"
}
'import requests
url = "https://checkout.beem.africa/v1/whitelist/add-to-list"
payload = { "website": "https://example.com" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({website: 'https://example.com'})
};
fetch('https://checkout.beem.africa/v1/whitelist/add-to-list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://checkout.beem.africa/v1/whitelist/add-to-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'website' => 'https://example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://checkout.beem.africa/v1/whitelist/add-to-list"
payload := strings.NewReader("{\n \"website\": \"https://example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://checkout.beem.africa/v1/whitelist/add-to-list")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"website\": \"https://example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://checkout.beem.africa/v1/whitelist/add-to-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"website\": \"https://example.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "successful"
}{
"status": 400,
"message": "\"website\" is required"
}{
"code": 120,
"message": "Invalid Authentication Parameters"
}{
"status": 403,
"message": "Please make sure your using a secured connection i.e https"
}Authorizations
basicAuthaccessToken
Beem API credentials: API key as username, API secret as password.
Body
application/json
HTTPS URL of the website that will use checkout.
Example:
"https://example.com"
⌘I
