Appearance
Initiating Payment Request ​
To collect a payment, you need to send a request with the required customer and transaction details.
URL: {BASEURL}/pay
💡 Check out the Send OTP.
Required parameters:
| Field Name | Structure/Key | Type | Description |
|---|---|---|---|
| Transaction ID | transaction_id | string | This is the unique identifier for the transaction |
| Merchant ID | merchant_id | string | This is the unique identifier assigned to a merchant, used to associate transactions and requests with the correct merchant account |
| Wallet Currency | currency | string | Specifies the currency in which the transaction is conducted, typically represented using the ISO 4217 currency code (e.g., KSH, GHS, NGN etc). Note that this must correspond with the wallet you have created on your account. |
| Payment Detail | payment_details | Object | Contains detailed information about the payment |
| Mobile Money | payment_details.momo_number | string | The active mobile money number you want to debit for the transaction. This number should include the country code (e.g., +233XXX) and identify the customer’s mobile money account to be charged. |
| One-Time Password | payment_details.otp | string | The One-Time Password sent to the intended payer before initiating the debit request. It is used to authenticate and authorize the transaction. |
| Customer Email | payment_details.customer_email | string | The payer’s email |
| Customer First name | payment_details.customer_firstname | string | The payer or customer first name |
| Customer Last name | payment_details.customer_lastname | string | The payer or customer last name |
| Description | payment_details.description | string | A brief note about the payment, such as the purpose of the transaction or details for the payer. This helps provide context for both the merchant and the customer. |
| Payment Method ID | payment_details.payment_method_id | string | A Brij-generated unique ID identifying the payment method used in the transaction. |
| Amount | amount | Numeric string | The total value of the transaction to be processed, represented as a string of digits (e.g., "5000"). |
:::
​
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{BaseURL}}/pay',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"transaction_id": "Your Unique Transaction ID",
"merchant_id": "Your Brij Merchant ID",
"currency": "Your Intended wallet currency", //e.g: GHS, NGN, KSH etc
"payment_details": {
"momo_number": "+24370XXXXX",
"otp": "651XXX",
"customer_email": "Customer Email",
"customer_firstname": "Customer First name",
"customer_lastname": "Customer Last name",
"description": "reason for payment"
},
"payment_method_id": "Brij payment method ID",
"amount": "amount"
}',
CURLOPT_HTTPHEADER => array(
'X-Requested-With: XMLHttpRequest',
'Content-Type: application/json',
'Authorization: Bearer YOUR_SECRET_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;js
var request = require('request');
var options = {
'method': 'POST',
'url': '{{BaseURL}}/pay',
'headers': {
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_SECRET_KEY'
},
body: JSON.stringify({
"transaction_id": "Your Unique Transaction ID",
"merchant_id": "Your Brij Merchant ID",
"currency": "Your Intended wallet currency", //e.g: GHS, NGN, KSH etc
"payment_details": {
"momo_number": "+24370XXXXX",
"otp": "651XXX",
"customer_email": "Customer Email",
"customer_firstname": "Customer First name",
"customer_lastname": "Customer Last name",
"description": "reason for payment"
},
"payment_method_id": "Brij payment method ID",
"amount": "amount"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});bash
curl --location '{{BaseURL}}/pay' \
--header 'X-Requested-With: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--data-raw '{
"transaction_id": "Your Unique Transaction ID",
"merchant_id": "Your Brij Merchant ID",
"currency": "Your Intended wallet currency", //e.g: GHS, NGN, KSH etc
"payment_details": {
"momo_number": "+24370XXXXX",
"otp": "651XXX",
"customer_email": "Customer Email",
"customer_firstname": "Customer First name",
"customer_lastname": "Customer Last name",
"description": "reason for payment"
},
"payment_method_id": "Brij payment method ID",
"amount": "amount"
}'Response
