Skip to content

Card Payment

The Card Payment method allows customers to securely pay using their debit or credit cards. This option supports online transactions and provides a fast and convenient way to complete payments.

URL: {BASEURL}/pay

Field NameStructure/KeyTypeDescription
Transaction IDtransaction_idstringThis is the unique identifier for the transaction
Merchant IDmerchant_idstringThis is the unique identifier assigned to a merchant, used to associate transactions and requests with the correct merchant account
Wallet CurrencycurrencystringSpecifies 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 Detailpayment_detailsObjectContains detailed information about the payment
Mobile Moneypayment_details.momo_numberstringThe active mobile number.
One-Time Passwordpayment_details.otpstringThe One-Time Password sent to the intended payer before initiating the debit request. It is used to authenticate and authorize the transaction.
Customer Emailpayment_details.customer_emailstringThe payer’s email
Customer First namepayment_details.customer_firstnamestringThe payer or customer first name
Customer Last namepayment_details.customer_lastnamestringThe payer or customer last name
Descriptionpayment_details.descriptionstringA 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.
Card Numberpayment_details.card_numberstringThe primary number printed on the customer’s card, used to debit the card for the transaction.
CVVpayment_details.card_cvvstringThe 3- or 4-digit security code on the customer’s card, used to verify and authorize the card for the transaction
Card Expiry Monthpayment_details.expiry_monthstringThe month when the customer’s card expires, used to validate the card for the transaction.
Card Expiry YearamountstringThe year when the customer’s card expires, used to validate the card for the transaction.
Name on Cardpayment_details.name_on_cardstringThe cardholder’s name as printed on the card, used to verify ownership during the transaction.
Payment Method IDpayment_method_idstringA Brij-generated unique ID identifying the payment method used in the transaction.
AmountamountNumeric stringThe total value of the transaction to be processed, represented as a string of digits (e.g., "5000").

💡 only 3-DSS cards are supported

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": "Transaction ID",
    "merchant_id": "Merchant ID",
    "currency": "Wallet Currency",
    "payment_details": {
        "otp": "367***",
        "card_number": "10************10",
        "card_cvv": "***",
        "expiry_month": "**", //e.g 01, 12, 08
        "expiry_year": "**",  //e.g 24, 25, 
        "name_on_card": "Test Test",
        "momo_number": "+24370XXXXX",
        "customer_email": "Customer Email",
        "customer_firstname": "Customer First name",
        "customer_lastname": "Customer Last name",
        "description": "Payment Description"
    },
    "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': '{{BaseULR}}/pay',
  'headers': {
    'X-Requested-With': 'XMLHttpRequest',
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_SECRET_KEY'
  },
  body: JSON.stringify({
    "transaction_id": "Transaction ID",
    "merchant_id": "Merchant ID",
    "currency": "Wallet Currency",
    "payment_details": {
      "otp": "367***",
      "card_number": "10************10",
      "card_cvv": "***",
      "expiry_month": "**",
      "expiry_year": "**",
      "name_on_card": "Name on Card",
      "momo_number": "+24370XXXXX",
      "customer_email": "Customer Email",
      "customer_firstname": "Customer First name",
      "customer_lastname": "Customer Last name",
      "description": "Payment Description"
    },
    "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": "Transaction ID",
    "merchant_id": "Merchant ID",
    "currency": "Wallet Currency",
    "payment_details": {
        "otp": "367***",
        "card_number": "Card Number",
        "card_cvv": "***",
        "expiry_month": "**",
        "expiry_year": "**",
        "name_on_card": "Name on Card",
        "momo_number": "+24370XXXXX",
        "customer_email": "Customer Email",
        "customer_firstname": "Customer First name",
        "customer_lastname": "Customer Last name",
        "description": "Payment Description"
    },
    "payment_method_id": "Brij payment method ID",
    "amount": "amount"
}'
Response