Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AccountBalanceResult = Type("AccountBalanceResult", func() {
Attribute("ResultType", Int, func() {
Example(0)
})
Attribute("ResultCode", Int, func() {
Example(0)
})
Attribute("ResultDesc", String, func() {
Example("The service request has b een accepted successfully.")
})
Attribute("OriginatorConversationID", String, func() {
Example("19464-802673-1")
})
Attribute("ConversationID", String, func() {
Example("AG_20170728_0000589b6252f7f25488")
})
Attribute("TransactionID", String, func() {
Example("LGS0000000")
})
Attribute("ResultParameters", func() {
Attribute("ResultParameter", func() {
Attribute("AccountBalance", MapOf(String, String), func() {
Key(func() {
MinLength(1)
Example("AccountBalance")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("Working Account|KES|46713.00|46713.00|0.00|0.00&Float Account|KES|0.00|0.00|0.00|0.00&Utility Account|KES|49217.00|49217.00|0.00|0.00&Charges Paid Account|KES|-220.00|-220.00|0.00|0.00&Organization Settlement Account|KES|0.00|0.00|0.00|0.00")
})
})
Attribute("BOCompletedTime", MapOf(String, Int), func() {
Key(func() {
MinLength(1)
Example("BOCompletedTime")
})
Elem(func() {
Format(FormatDateTime)
Example(20170728095642)
})
})
})
})
Attribute("ReferenceData", func() {
Attribute("ReferenceItem", MapOf(String, String), func() {
Key(func() {
MinLength(1)
Example("QueueTimeoutURL")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("https://internalsandbox.safaricom.co.ke/mpesa/abresults/v1/submit")
})
})
})
})
View Source
var B2CPaymentResult = Type("B2CPaymentResult", func() {
Attribute("Result", func() {
Attribute("ResultType", Int, func() {
Description("Status code that indicates whether the transaction was already sent")
Default(0)
})
Attribute("ResultCode", Int, func() {
Description("Numeric status code that indicates the status of the transaction processing")
Example(0)
})
Attribute("ResultDesc", String, func() {
Description("Message from the API that gives the status of the request")
Enum("Service request is has bee accepted successfully", "Initiator information is invalid")
})
Attribute("OriginatorConversationId", String, func() {
Description("Global unique identifier for the transaction request.")
Example("AG_2376487236_126732989KJHJKH")
})
Attribute("ConversationId", String, func() {
Description("Global unique identifier for the transaction request.")
Example("236543-276372-2")
})
Attribute("TransactionID", String, func() {
Description("Unique M-PESA transaction ID for every payment request.")
Example("LHG31AA5TX")
})
})
Attribute("ResultParameters", func() {
Attribute("ResultParameter", func() {
Attribute("TransactionReceipt", MapOf(String, String), func() {
Description("This is a unique M-PESA transaction ID for every payment request.")
Key(func() {
MinLength(1)
Example("TransactionReceipt")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("LGH3197RIB")
})
})
Attribute("TransactionAmount", MapOf(String, Int), func() {
Description("This is the amount that was transacted.")
Key(func() {
MinLength(1)
Example("TransactionAmount")
})
Elem(func() {
MinLength(0)
Example(8000)
})
})
Attribute("B2CWorkingAccountAvailableFunds", MapOf(String, Int64), func() {
Description("Available balance of the Working account under the B2C shortcode used in the transaction.")
Key(func() {
MinLength(1)
Example("B2CWorkingAccountAvailableFunds")
})
Elem(func() {
MinLength(0)
Example(150000)
})
})
Attribute("B2CUtilityAccountAvailableFunds", MapOf(String, Int64), func() {
Description("Available balance of the Utility account under the B2C shortcode used in the transaction.")
Key(func() {
MinLength(1)
Example("B2CUtilityAccountAvailableFunds")
})
Elem(func() {
MinLength(0)
Example(133568)
})
})
Attribute("TransactionCompletedDateTime", MapOf(String, String), func() {
Description("This is the date and time that the transaction completed M-PESA.")
Key(func() {
MinLength(1)
Example("TransactionCompletedDateTime")
})
Elem(func() {
Format(FormatDateTime)
Example("17.07.2017 10:54:57")
})
})
Attribute("ReceiverPartyPublicName", MapOf(String, String), func() {
Description("This is the name and phone number of the customer who received the payment.")
Key(func() {
MinLength(1)
Example("ReceiverPartyPublicName")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("254708374149 - John Doe")
})
})
Attribute("B2CChargesPaidAccountAvailableFunds", MapOf(String, Int64), func() {
Description("Available balance of the Charges Paid account under the B2C shortcode used in the transaction.")
Key(func() {
MinLength(1)
Example("B2CChargesPaidAccountAvailableFunds")
})
Elem(func() {
Minimum(0)
Example(0)
})
})
Attribute("B2CRecipientIsRegisteredCustomer", MapOf(String, String), func() {
Description("This is a key that indicates whether the customer is a M-PESA registered customer or not")
Key(func() {
MinLength(1)
Example("ReceiverPartyPublicName")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Enum("Y", "N")
Example("Y")
})
})
})
})
Attribute("ReferenceData", func() {
Attribute("ReferenceItem", MapOf(String, String), func() {
Key(func() {
MinLength(1)
Example("QueueTimeoutURL")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("https://internalsandbox.safaricom.co.ke/mpesa/b2cresults/v1/submit")
})
})
})
})
View Source
var ConfirmationResult = Type("ConfirmationResult", func() {
Attribute("TransactionType", String, func() {
Description("The transaction type specified during the payment request.")
Enum("Buy Goods", "Pay Bill")
})
Attribute("TransID", String, func() {
Description("Unique M-Pesa transaction ID for every payment request")
Example("LHG31AA5TX")
})
Attribute("TransTime", String, func() {
Description("Timestamp of the transaction")
Format(FormatDateTime)
Example("20180713154301")
})
Attribute("TransAmount", Int, func() {
Description("The Amount transacted normally a numeric value")
Example(100)
})
Attribute("BusinessShortCode", Int, func() {
Description("Organizations shortcode (Paybill or Buygoods)")
MinLength(5)
MaxLength(6)
Example(654321)
})
Attribute("BillRefNumber", String, func() {
Description("Account number for which the customer is making the payment")
MaxLength(20)
})
Attribute("InvoiceNumber", String)
Attribute("OrgAccountBalance", Int64, func() {
Description("Current utility account balance of the payment receiving organization shortcode")
Example(30671.00)
})
Attribute("ThirdPartyTransID", String)
Attribute("MSISDN", Int, func() {
Description("Mobile number of the customer making the payment.")
})
Attribute("FirstName", String, func() {
Description("First Name of the customer making the payment.")
Example("John")
})
Attribute("MiddleName", String, func() {
Description("Middle Name of the customer making the payment.")
Example("Doe")
})
Attribute("LastName", String, func() {
Description("Last Name of the customer making payment.")
Example("Jane")
})
})
View Source
var Item = Type("Item", func() {
Attribute("Amount", MapOf(String, Int64), func() {
Description("This is the Amount that was transacted")
Key(func() {
Example("Amount")
})
Elem(func() {
Example(10500.5)
})
})
Attribute("MpesaReceiptNumber", MapOf(String, String), func() {
Description("Unique M-PESA transaction ID for the payment request")
Key(func() {
Example("MpesaReceiptNumber")
})
Elem(func() {
Example("LHG31AA5TX")
})
})
Attribute("Balance", MapOf(String, Int64), func() {
Description("Balance of the account for the shortcode used as partyB")
Key(func() {
Example("Balance")
})
Elem(func() {
Example(32009.9)
})
})
Attribute("TransactionDate", MapOf(String, String), func() {
Description("Timestamp representing transaction date time completion")
Key(func() {
Example("TransactionDate")
})
Elem(func() {
Format(FormatDateTime)
Example("20170827163400")
})
})
Attribute("PhoneNumber", MapOf(String, Int), func() {
Description("Number of the customer who made the payment.")
Key(func() {
Example("PhoneNumber")
})
Elem(func() {
Example(0722000000)
})
})
})
View Source
var LNMOResult = ResultType("LNMOResult", func() { Attribute("Body", func() { Attribute("StkCallback", func() { Attribute("MerchantRequestID", String, func() { Example("8555-67195-1") }) Attribute("CheckoutRequestID", String, func() { Example("ws_CO_27072017151044001") }) Attribute("ResultCode", Int, func() { Example(1032) }) Attribute("ResultDesc", String, func() { Example("[STK_CB - ]Request cancelled by user") Example("The service request is processed successfully.") }) Attribute("CallbackMetadata", ArrayOf(Item)) }) }) })
View Source
var ReversalResult = Type("ReversalResult", func() {
Description("Successful Reversal Callback")
Attribute("Result", func() {
Attribute("ResultType", Int, func() {
Example(0)
})
Attribute("ResultCode", Int, func() {
Example(0)
})
Attribute("ResultDesc", String, func() {
Example("The service request has been accepted successfully.")
})
Attribute("OriginatorConversationID", String, func() {
Example("10819-695089-1")
})
Attribute("ConversationID", String, func() {
Example("AG_20170727_00004efadacd98a01d15")
})
Attribute("TransactionID", String, func() {
Example("LGR019G3J2")
})
Attribute("ReferenceData", func() {
Attribute("ReferenceItem", MapOf(String, String), func() {
Key(func() {
MinLength(1)
Example("QueueTimeoutURL")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("https://internalsandbox.safaricom.co.ke/mpesa/reversalresults/v1/submit")
})
})
})
})
})
Note the TransactionID. This is the transaction ID of the reversal request itself, not the original transaction which was being reversed. The reversal request itself gets its own transaction ID.
View Source
var TransactionStatusResult = Type("TransactionStatusResult", func() {
Attribute("Result", func() {
Attribute("ResultType", Int, func() {
Example(0)
})
Attribute("ResultCode", Int, func() {
Example(0)
})
Attribute("ResultDesc", String, func() {
Example("The service request has been accepted successfully")
})
Attribute("OriginatorConversationID", String, func() {
Example("10816-694520-2")
})
Attribute("ConversationID", String, func() {
Example("AG_20170727_000059c52529a8e080bd")
})
Attribute("TransactionID", String, func() {
Example("LGR0000000")
})
Attribute("ResultParameters", func() {
Attribute("ResultParameter", func() {
Attribute("ReceiptNo", MapOf(String, String), func() {
Key(func() {
Example("ReceiptNo")
})
Elem(func() {
Example("LGR919G2AV")
})
})
Attribute("Conversation ID", MapOf(String, String), func() {
Key(func() {
Example("Conversation ID")
})
Elem(func() {
Example("AG_20170727_00004492b1b6d0078fbe")
})
})
Attribute("FinalisedTime", MapOf(String, Int), func() {
Key(func() {
Example("FinalisedTime")
})
Elem(func() {
Example(20170727101415)
})
})
Attribute("Amount", MapOf(String, Int64), func() {
Key(func() {
Example("Amount")
})
Elem(func() {
Example(10)
})
})
Attribute("TransactionStatus", MapOf(String, String), func() {
Key(func() {
Example("TransactionStatus")
})
Elem(func() {
Example("Completed")
})
})
Attribute("ReasonType", MapOf(String, String), func() {
Key(func() {
Example("ReasonType")
})
Elem(func() {
Example("Salary Payment via API")
})
})
Attribute("TransactionReason", MapOf(String, String), func() {
Key(func() {
Example("TransactionReason")
})
Elem(func() {
Example("Transaction Reason")
})
})
Attribute("DebitPartyCharges", MapOf(String, String), func() {
Key(func() {
Example("DebitPartyCharges")
})
Elem(func() {
Example("Fee For B2C Payment|KES|33.00")
})
})
Attribute("DebitAccountType", MapOf(String, String), func() {
Key(func() {
Example("DebitAccountType")
})
Elem(func() {
Example("Utility Account")
})
})
Attribute("InitiatedTime", MapOf(String, Int), func() {
Key(func() {
Example("InitiatedTime")
})
Elem(func() {
Example(20170727101415)
})
})
Attribute("Originator Conversation ID", MapOf(String, String), func() {
Key(func() {
Example("Originator Conversation ID")
})
Elem(func() {
Example("19455-773836-1")
})
})
Attribute("CreditPartyName", MapOf(String, String), func() {
Key(func() {
Example("CreditPartyName")
})
Elem(func() {
Example("254708374149 - John Doe")
})
})
Attribute("DebitPartyName", MapOf(String, String), func() {
Key(func() {
Example("DebitPartyName")
})
Elem(func() {
Example("600134 - Safaricom157")
})
})
})
})
Attribute("ReferenceData", func() {
Attribute("ReferenceItem", MapOf(String, String), func() {
Key(func() {
MinLength(1)
Example("Occasion")
})
Elem(func() {
Pattern("[a-zA-Z]+")
Example("Occasion")
})
})
})
})
})
View Source
var ValidationResult = Type("ValidationResult", func() {
Attribute("TransactionType", String, func() {
Description("The transaction type specified during the payment request.")
Enum("Buy Goods", "Pay Bill")
})
Attribute("TransID", String, func() {
Description("Unique M-Pesa transaction ID for every payment request")
Example("LHG31AA5TX")
})
Attribute("TransTime", String, func() {
Description("Timestamp of the transaction")
Format(FormatDateTime)
Example("20180713154301")
})
Attribute("TransAmount", Int, func() {
Description("The Amount transacted normally a numeric value")
Example(100)
})
Attribute("BusinessShortCode", Int, func() {
Description("Organizations shortcode (Paybill or Buygoods)")
MinLength(5)
MaxLength(6)
Example(654321)
})
Attribute("BillRefNumber", String, func() {
Description("Account number for which the customer is making the payment")
MaxLength(20)
})
Attribute("InvoiceNumber", String)
Attribute("OrgAccountBalance", Int64, func() {
Description("Current utility account balance of the payment receiving organization shortcode")
Example(30671.00)
})
Attribute("ThirdPartyTransID", String)
Attribute("MSISDN", Int, func() {
Description("Mobile number of the customer making the payment.")
})
Attribute("FirstName", String, func() {
Description("First Name of the customer making the payment.")
Example("John")
})
Attribute("MiddleName", String, func() {
Description("Middle Name of the customer making the payment.")
Example("Doe")
})
Attribute("LastName", String, func() {
Description("Last Name of the customer making payment.")
Example("Jane")
})
})
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.