TV
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '<string>', product_name: '<string>', reference: '<string>'})
};
fetch('https://app.datashop.africa/api/v2/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.datashop.africa/api/v2/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "<string>",
"product_name": "<string>",
"reference": "<string>"
}
'import requests
url = "https://app.datashop.africa/api/v2/purchase"
payload = {
"customer_id": "<string>",
"product_name": "<string>",
"reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.datashop.africa/api/v2/purchase",
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([
'customer_id' => '<string>',
'product_name' => '<string>',
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Purchases
TV
Pay for a TV subscription package.
POST
/
api
/
v2
/
purchase
TV
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '<string>', product_name: '<string>', reference: '<string>'})
};
fetch('https://app.datashop.africa/api/v2/purchase', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.datashop.africa/api/v2/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "<string>",
"product_name": "<string>",
"reference": "<string>"
}
'import requests
url = "https://app.datashop.africa/api/v2/purchase"
payload = {
"customer_id": "<string>",
"product_name": "<string>",
"reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.datashop.africa/api/v2/purchase",
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([
'customer_id' => '<string>',
'product_name' => '<string>',
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Submit a TV subscription payment after selecting the package and confirming the customer number when required. Keep the reference for receipt display and follow-up status checks.
Request body
string
required
Smartcard number, IUC number, or customer identifier for the TV provider.
string
required
TV package selected from List products.
string
required
Unique transaction reference from your system. Must be 15 to 40 characters.
Request
{
"customer_id": "1234567890",
"product_name": "dstv-padi",
"reference": "merchant-ref-20260812003"
}
Successful response
{
"status": true,
"message": "Purchase processed successfully.",
"data": {
"reference": "merchant-ref-20260812003",
"customer_id": "1234567890",
"service": "tv",
"provider": "DSTV",
"product_name": "dstv-padi",
"quantity": "3600",
"paid_amount": 3600,
"transaction_status": "successful",
"remark": "Purchase successful"
}
}
Processing response
{
"status": true,
"message": "Purchase is processing.",
"data": {
"reference": "merchant-ref-20260812003",
"customer_id": "1234567890",
"service": "tv",
"provider": "DSTV",
"product_name": "dstv-padi",
"quantity": "3600",
"paid_amount": 3600,
"transaction_status": "processing"
}
}
Failed response
{
"status": false,
"message": "Error message"
}
⌘I