Payment Gateway

Initialize Transaction

POST

Endpoint: https://app.moneta.ng/api/v1/transaction/initialize

Initialize a transaction from your backend by preparing the necessary parameters for the payment gateway.

Request Parameters

ParameterTypeRequiredDescription
amountnumberRequiredAmount in kobo (e.g., 800000 for ₦8,000)
emailstringRequiredCustomer's email address
callback_urlstringRequiredURL to redirect after payment
payment_typestringRequiredPayment method (e.g., 'card')
channelstringRequiredPayment channel
metadataobjectOptionalAdditional information about the transaction

Code Examples

PHP Example

php
<?php
$email="";
$amount=""; 
$payment_type=""; 
$callback_url="";
$mac = "";
$mystring = $email . $amount. $payment_type . $callback_url;
$hash = hash_hmac('sha512', $mystring, $mac, false);

JavaScript Example

javascript
import * as CryptoJS from 'crypto-js';

function generateHash(email, amount, payment_type, callback_url, mac) {
  const myString = email + amount + payment_type + callback_url;

  return CryptoJS.HmacSHA512(myString, mac).toString(CryptoJS.enc.Hex);
}

Response

Success Response

{
  "status": "success",
  "responseCode": "00",
  "url": "your callback URL",
  "ref_no": "Moneta Reference",
  "type": "card",
  "authorization_url": "payment link"
}

Important Note

Always verify the transaction status using the verification endpoint after receiving a callback.