Skip to main content

mEarn

mEarn is a utility for mBnk to track transactions wherein leads are converted at service providers end.

Service providers can create those transactions with mBnk, when leads are coverted in service provider's system. These transactions helps mBnk to track the revenue share disbursal with its distributors and retailers.

Implementation of mBnk mEarn


Step 1

The mBnK mEarn has to initialized with Payment Information

  • key will be provided to you by mBnK and will be unique to you
  • hash to be generated using SHA512 with | as separator of key,transactionId,amount and salt
  • transactionId must be unique transactionId provided by you
  • isProductOrService specify whether your are offering a product or service
  • amount the total amount for goods or services e.g. 100.00/100.50
  • logo The logo url of the service provider (would be shown to retailer in mBnk mPay UI)
  • productOrServices A list of Product or Service information
    • id Product or Service ID assigned by service provider e.g. SKU, id, key
    • categoryId Category ID would be provided by mBnk to you
    • description Product or Service information
    • amount The Amount or Cost of the Product or Service e.g. 100.00/100.50
  • customer Customer information must be passed here
    • mobileNo Customer's Mobile No
    • name Customer's name
    • email Customer's Email ID
  • retailer Retailer information must be passed here
    • id Retailer's ID sent by mBnk
    • mobileNo Retailer's Mobile No sent by mBnk
info

Pass either the Retailer's ID or Mobile No, not both the fields in request.

note

Hash to be generated using SHA512 with | as separator of key,transactionId,amount and salt

URL:- https://callback-integration-gw-a7lt8d4h.an.gateway.dev/api/mbnk-earn/initiate?key=yourUniqueKey

  • key Key would be provided by mBnk. The key is authorization for the above Url.

Request Payload

{    key: "your-key", // the key provided by mBnk    hash: "random string", // Hash generated using above logic needs to be set here    transactionId: "123456789", // The unique transaction Id generated by you    isProductOrService: true, // Is it product or service that you are offering    productOrServices: [        {            id: "test", // The Product or Service ID can be a SKU, id, etc.            categoryId: 'test', // Will be provided by mBnk            description: "Test Product", // The information of the Product or Service            amount: "100.00" // The cost of the Product or Service        }    ],    customer: { // Optional, if provided would be better        name: "Test Test", // Customer's Name        email: "test@mbnk.com", // Customer's Email ID        mobileNo: "9757000000", // Customer's Mobile No    }    amount: "100.00", // The total amount of the transaction,    retailer: { // Retailer Information needs to be provided        id: "", // Retailer's ID        mobileNo: "9757000000", // Retailer's Mobile No    }}
note

There are two environment wherein Service Provider can invoke mBnk mEarn

Responses :-

  • Transaction The transaction object would contain the transaction information
{
amount: "100.00", // The total amount of the transaction
clientTransactionId: "123456789", // The transaction ID provided by you
message: "Transaction Successful", // The transaction message
status: "PENDING" // The status of transaction
transactionId: "aaaaaaaaa", // The transaction ID provided by mBnk
date: "2021-12-30T06:45:06.320Z", // The date of the transaction in ISO8601 format
hash: "random string", // These hash needs to be verified by service provider
}
  • Initialization Failed
{
statusCode: "xxxx",
message: "message" // The error message will be sent in here
}

If the transaction request object is not proper, the 'Initialization Failed' object would be returned.

note

Hash needs to be verified at server side using SHA512 with | as separator of key, transactionId, clientTransactionId, amount, status and salt

caution

Salt needs to be stored in backend and never to be exposed in client as it is used to verify and generate hash for the transaction.

Try mBnk mEarn

Service Provider Information