Endpoints
Payment

Payment Request

7min

Initiate a payment request that sends a USSD prompt to the Customer for Payment

POST
Request
Header Parameters
X-Api-Key
required
String
Your API Key
X-Api-User
required
String
Username for your Moolre Account
Content-Type
required
String
Set value to: "application/json"
Body Parameters
type
required
Integer
Function ID or action ID to be performed
accountnumber
required
String
Wallet account number to be used in performing a transaction or generating a terminal ID/Address. This can be found when you log in on Moolre
amount
required
Number
Amount to be paid/debitted from the Customer
payer
required
String
Phone number of the payer
channel
required
Integer
The network/channel to be used for the transfer "7" - AT "13" - MTN "6" - Vodafone
currency
required
String
The currency of your transfer "GHS" - Ghana Cedis
externalref
required
String
Unique Identified you provide. You can use this ID later to check transaction status.
otp
required
Integer
Used for sending sms code and/or verifying sms code "2" - SMS based OTP Code (Recommended) "1" - USSD based phone number verification
otpcode
optional
String
OTP Code sent via SMS to the Customer to be used in the second step of the transaction
reference
optional
String
Narration/Reference for the payment



Sample Request & Response

Step 1 - Initiating the payment request

Request
Response


Step 2 - Verifying the payee's number

Request
Response - Failure
Response - Success


Step 3 - Pushing the payment request to the payee

The customer will receive a prompt on their device asking them to approve the payment by entering their mobile money pincode.

Callback

You will receive a callback in the format below to your callback URL when the payment is successful

Callback


In the event of manual transaction status check, txstatus = 2 with code = SS07and message=Transaction not found will be returned if the transaction is not found or is not yet completed and approved by the customer. Payment Request transactions are recorded only after they are successful.



Never assume a payment is successful unless the payment callback or status check response txstatus indicates success.



Callback Parameters

Parameters

Description

Data Type

status

Status of the api request

  • 1 - Success
  • 0 - Failure

Int

code

Unique Identifier for the different possible responses

String

message

Endpoint response message

String/Array

go

Not applicable to this endpoint

null

data

An object that contains below parameters

Object

txstatus

Status of the transfer

  • "1" - Success
  • "0" - Pending
  • "2" - Failure

Double

payer

Transaction Type

String

accountnumber

Account number of the wallet used for the transfer

Array

amount

Recipient of the transfer

String

value

Amount transfered

String

transactionid

Moolre generated transaction ID

String

externalref

This is the externalrefyou provided

String

thirdpartyref

Transaction ID generated by the transfer network

String

secret

A secret to help verify the source of the callback

String

ts

Date and Time of the Transaction in EST

String



Updated 18 Jun 2024
Doc contributor
Did this page help you?