![Bezza Logo](images/BezzaBlk_logo.png)
Bezza API Documentation
Your Gateway to Seamless API Integration
How It Works
The Bezza API enables seamless integration for handling payments, balances, and customer data.
- Authentication: Use your API key to authenticate requests.
- Endpoints: Access multiple endpoints like
/pay_api_meterId
and/payment_status
. - Real-time Updates: Track payment statuses in real time.
How to Integrate Bezza API
Follow these steps to integrate the Bezza API into your application:
- Obtain your API key from the Bezza dashboard.
- Use the API key to authenticate your requests.
- Start sending requests to Bezza endpoints based on your requirements.
Example Code
Node.js
const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const url = 'https://api.bezza.io/pay_api_meterId';
const data = {
amount: '10.50',
phone: '123456789',
meterId: 'METER_ID',
paymentType: 'Zaad'
};
axios.post(url, data, {
headers: { 'Authorization': `Bearer ${apiKey}` }
})
.then(response => {
console.log('Payment initiated:', response.data);
})
.catch(error => {
console.error('Error:', error.response.data);
});
Python
import requests
api_key = 'YOUR_API_KEY'
url = 'https://api.bezza.io/pay_api_meterId'
data = {
"amount": "10.50",
"phone": "123456789",
"meterId": "METER_ID",
"paymentType": "Zaad"
}
headers = {
"Authorization": f"Bearer {api_key}"
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
print("Payment initiated:", response.json())
else:
print("Error:", response.json())
Bezza Checkout
Bezza Checkout is a flexible, secure, and seamless way to integrate payment processing into your application.
Features:
- Initiate payments with USSD codes.
- Track real-time payment statuses.
- Supports multiple payment methods.
To integrate Bezza Checkout, use the following API endpoint:
POST /pay_api_meterId
Request Parameters:
- amount: Payment amount.
- phone: Customer phone number.
- meterId: Unique meter identifier.
- paymentType: Type of payment (e.g., Zaad).
Example Response:
{
"message": "Payment Initiated. Dial USSD to proceed.",
"ussdCode": "*789*630533*10*50#",
"meterId": "METER_ID"
}
See Example Code