Payment
mPay
Initiate Payment

API Information

Name: mPAY Initiate Payment

Description: It will create the payment record with an order reference number. This order reference number will be used in future to confirm the payment made by MPay.

Basic Info

Basic
Method: POST
Endpoint: <API_BASE_URL>/mapi/api/v1/payment/mpay/initiate
 
---
 
REQUEST HEADERS:
x-api-token: <REQUIRED>
Content-Type: application/json

Request Body

JSON
{
  "initiateServiceRequest": {
    "properties": {
      "property": [
        {
          "name": "epay-spcode",
          "value": "INSURANCEMARKET" // (mandatory) Code returned after creating car quote request
        },
        {
          "name": "codeRef",
          "value": "E2QZTKWY" // (mandatory) Code returned after creating car quote request
        },
        {
          "name": "quoteTypeId",
          "value": "1" // (mandatory) It is used to identify the type of quote. e.g Use '1' for Car
        },
        {
          "name": "planId",
          "value": "79" // (mandatory) It is found against the plan which is returned from Get Car Quote Plan API
        },
        {
          "name": "addonOptionIds",
          "value": "1,2,3,4,5" // (optional) Each plan has certain addons with different options. Use addon-option-ids whic is present inside a plan with addon and its options.
        },
        {
          "name": "policyStartDate",
          "value": "2022-05-23 06:25:36" // (optional) when do you want your policy to start
        }
      ]
    },
    "messageDigest": "ABCDEFGHIJKLMNOP" // hashed value for checksum
  }
}

Response Body

Success
JSON
{
  "initiateServiceRequestResponse": {
    "statusCode": "00",
    "statusDescription": "success",
    "epay-sptrn": "im_wmmh5akdx3jyn73yqsbmzqy8szsrcd", // order reference number generated against the payment record
    "serviceTransactionTime": "2011-04-16T11:22:30",
    "transactionAmount": "100"
  }
}
Failed (Checksum Failed)
JSON
{
  "initiateServiceRequestResponse": {
    "statusCode": "33",
    "statusDescription": "Checksum Failed",
    "epay-sptrn": "",
    "serviceTransactionTime": "",
    "transactionAmount": ""
  }
}
Failed (Internal System Error)
JSON
{
  "initiateServiceRequestResponse": {
    "statusCode": "99",
    "statusDescription": "Internal System Error",
    "epay-sptrn": "",
    "serviceTransactionTime": "",
    "transactionAmount": ""
  }
}
Failed (Validation Error)
JSON
{
  "code": "VALIDATION_ERROR",
  "message": "property[0].name must be string", // shows respective field validation error
  "type": "WARN"
}