Disclaimer

THIS DOCUMENT AND THE INFORMATION HEREIN ARE THE PROPERTY OF PayPro (PVT.) LTD. ALL UNAUTHORIZED USE AND REPRODUCTION IS STRICTLY PROHIBITED. COPYRIGHT 2020 BY PayPro (PVT.) LTD. ALL RIGHTS RESERVED.

CONFIDENTIAL, UNPUBLISHED PROPERTY OF PayPro (PVT.) LTD. FOR INTERNAL USE ONLY

Introduction

This Web API is used to manage orders in PayPro Fintech Invoicing System.

1.0 Single Order Creation

The Order Creation JSON is passed in the URL in the following pattern

API Signature

https://{Base URL goes here}/cpay/co?oJson=

HTTP Method

POST

Note:

Input Parameters

Object will be sent as JSON file, with following Parameters:

Parameter

Description

Mandatory/Optional

Data Type

OrderNumber

Must be unique

M

String(256)

MerchantId

userID

M

String(15)

MerchantPassword

userPassword

M

String(60)

OrderAmount

Must be with the limits defined on user creation

M

decimal(18,2)

OrderDueDate

 

M

yyyy-MM-dd

OrderType

“Service”

M

 

IssueDate

 

M

yyyy-MM-dd

CustomerName

 

M

String(32)

CustomerMobile

valid mobile number

M

String(11)

CustomerEmail

valid email address

M

String(32)

CustomerAddress

 

M

String(64)

Expiry After Seconds

The time after which order is blocked

O

int

 

JSON object samples

 

Single Object

[{

    "MerchantId":   "PayProUser",

    "MerchantPassword":  "Password"

}, {

    "OrderNumber":  "OpenCart115319",

    "OrderAmount":  "4400",

    "OrderDueDate":  "21\/03\/2020",

    "OrderAmountWithinDueDate":  "4400",

    "OrderAmountAfterDueDate":  "4400",

    "OrderType":  "Service",

    "IssueDate":  "14\/03\/2020",

    "OrderExpireAfterSeconds":  "0",

    "CustomerName":  "Umer Aziz",

    "CustomerMobile":  "03123456789",

    "CustomerEmail":  "",

    "CustomerAddress":  ""

}]

 

 

JSON object sample

 

https://{Base URL Goes Here}/cpay/co?oJson=[{

"MerchantId": "  PayProUser ","MerchantPassword": " Password "}, {"OrderNumber""OpenCart115319","OrderAmount""4400","OrderDueDate""21\/04\/2020","OrderAmountWithinDueDate": "4400","OrderAmountAfterDueDate":"4400","OrderTypeId""Service","OrderType""Service","IssueDate""14\/03\/2020" ,"TransactionStatus""UNPAID","CustomerName""Saim Ali","CustomerMobile""02345678910","CustomerEmail""","CustomerAddress""","CustomerBank"""

}]

 

 

Response JSON Format

 

The output JSON has three parameters per order

  • 1) Status

  • 2) ConnectPayId (Only in case of success)

  • 3) Description

  • 4) ConnectPayFee

  • 5) OrderAmount

 

e.g.

 [

    {

        "Status""00"

    },

    {

        "Description""Order number H-5 created successfully",

        "OrderAmount""250001",

        "ConnectPayFee""60",

        "ConnectPayId""00342000600028",

        "OrderNumber""H5-317",

        "IsFeeApplied""True"

    }

]

Response codes with description

Ref: 1.1

Response Code

Description

00

Success

01

Order Already Exist

02

Service Fail

03

Invalid Data

04

User not Authorized

 

All Possible error description with their codes

Status

Description

03

If object sent from client has error

03

if  column name/count doesn’t match with defined columns

02

if error occurs in order creation:

03

when order amount is out of limits

04

When user is not authorized for service

03

When mobile no. and email is not in valid format:

03

When order number is not provided:

01

When order number already exists

03

When main table details are not provided

03

When main table details are not provided

 

Code usage in MVC ASP.NET C#

 

 

     public class ResponseViewModel

{

     public string Status { get; set; }

     public string Description { get; set; }

     public string ConnectPayId { get; set; }

     public string ConnectPayFee { get; set; }

     public string OrderNumber { get; set; }

     public string OrderAmount { get; set; }

     public string IsFeeApplied { get; set; }

}

     public ResponseViewModel placeOrder()

{

     var jsonOrder = [

{

]

     "MerchantId": "Abc",

     "MerchantPassword": "Password"

}, {

      "OrderNumber":  "H-5",

      "OrderAmount":   "250001",

      "OrderDueDate":  "18/12/2021",

      "OrderType""Service",

      "IssueDate""11/12/2020",

      "OrderExpireAfterSeconds":  "0",

     "CustomerName":  "Salman Afridi",

      "CustomerMobile""",

      "CustomerEmail""",

      "CustomerAddress":  ""

} ]";

]

      string baseUrl = "http://localhost/";

      string reqUri = baseUrl + "cpay/co?oJson=" + jsonOrder;

      WebClient client = new WebClient();

      var response = client.UploadString(reqUri, jsonOrder);

      var serializer = new JavaScriptSerializer();

      var model = serializer.Deserialize<IList<ResponseViewModel>>(response);

      if(model.Count > 0)

      {

     var status = model[0].Status;

      if(model[0].Status == "00")

     {

     //Order successfully created,

      //get createdorder details

      var connectpayId = model[1].ConnectPayId;

     var transactionFee = model[1].ConnectPayFee;

      var orderNumber = model[1].OrderNumber;

      var orderamount = model[1].OrderAmount;

      }

      else

      {

      //get description message

      var connectpayId = model[1].Description;

} }

 

2.0 Multiple Order Creation

Order creation API needs to be called with JSON object(s) sent in certain format in a (.txt) file. The details of the API are as under

 

API Signature

https://{Base URL goes here}/cpay/cmo

 

HTTP Method

POST

Input Parameters:

Object will be sent as JSON file, with following Parameters

Parameter

Description

Mandatory/Optional

Data Type

OrderNumber

Must be unique

M

String(256)

MerchantId

userID

M

String(15)

MerchantPassword

userPassword

M

String(60)

OrderAmount

Must be with the limits defined on user creation

M

decimal(18,2)

OrderDueDate

 

M

yyyy-MM-dd

OrderType

“Service”

M

 

IssueDate

 

M

yyyy-MM-dd

CustomerName

 

M

String(32)

CustomerMobile

valid mobile number

M

String(11)

CustomerEmail

valid email address

M

String(32)

CustomerAddress

 

M

String(64)

 

 

JSON object sample (single order)

[

{

        "MerchantId": "PayPro",

        "MerchantPassword""PayProi517"

},

 

{

    "OrderNumber""PayPro1022",

    "OrderAmount":"55000",

    "OrderDueDate":"28/02/2019",

    "OrderType":"Service",

    "IssueDate":"12/02/2018",

    "CustomerName":"Usman",

    "CustomerMobile":"",    

    "CustomerEmail":"",

    "CustomerAddress":""

 

}

]

 

 

JSON object sample (multiple orders)

[

{

        "MerchantId":"PayPro",

        "MerchantPassword":"PayProi517"

},

{

    "OrderNumber""PayPro1022",

    "OrderAmount":"55000",

    "OrderDueDate":"28/02/2019",

    "OrderType":"Service",

    "IssueDate":"12/02/2018",

    "CustomerName":"Usman",

    "CustomerMobile":"",

    "CustomerEmail":"",

    "CustomerAddress":""

},

{

    "OrderNumber""PayPro1023",

    "OrderAmount":"123",

    "OrderDueDate":"28/02/2019",

    "OrderType":"Service",

    "IssueDate":"12/02/2018",

    "CustomerName":"Usman",

    "CustomerMobile":"",

    "CustomerEmail":"",

    "CustomerAddress":""

}

]

 

 

 

Response JSON Format (Single Order)

1) Status
2) ConnectPayId (Only in case of success)
3) Description
4) ConnectPayFee
5) OrderAmount

 

e.g.

 [

    {

        "Status""00"

    },

    {

        "Description""Order number H-5 created successfully",

        "OrderAmount""250001",

        "ConnectPayFee""60",

        "ConnectPayId""00342000600028",

        "OrderNumber""H5-317",

       "IsFeeApplied""True"

    }

]

 

Response JSON Format (Multiple Orders)

 

[{

        "Status""00"

},

{

        "Description""Order number H-5 created successfully",

        "OrderAmount""250001",

        "ConnectPayFee""60",

        "ConnectPayId""00342000600028",

        "OrderNumber""H5-317",

        "IsFeeApplied""True"

 

},

{

        "Description""Order number H-6 created successfully",

        "OrderAmount""250001",

        "ConnectPayFee""60",

        "ConnectPayId""00342000600028",

        "OrderNumber""H5-317",

        "IsFeeApplied""True"

}

 

]        

 

Response codes with description

 

Ref: 1.1

Response Code

Description

00

Success

01

Order Already Exist

02

Service Fail

03

Invalid Data

04

User not Authorized

 

 

All Possible error description with their codes

Status

Description

03

If object sent from client has error

03

if  column name/count doesn’t match with defined columns

02

if error occurs in order creation:

03

when order amount is out of limits

04

When user is not authorized for service

03

When mobile no. and email is not in valid format:

03

When order number is not provided:

01

When order number already exists

03

When main table details are not provided

03

When main table details are not provided

 

Code usage in MVC ASP.NET C#

 

[HttpPost]

public ActionResult UploadOrder(HttpPostedFileBase file)

{

    if (file.ContentLength > 0)

    {               

      string requestUrl = "http://10.0.0.157:1099/cpay/cmo";

      string fileName = Path.GetFileName(file.FileName);

 

      if (fileName != null)

      {

         string path = Path.Combine(Server.MapPath("~/App_Data"), fileName);

         file.SaveAs(path);

         WebClient client = new WebClient();

         byte[] response = client.UploadFile(requestUrl, path);

         string result = System.Text.Encoding.UTF8.GetString(response);

         // Get json Result in jsonResult variable and process your logic

         string jsonResult = result;

       }

     }

   return View();

}

 

Note:

You can use this WebApi Method in two way.

First by using File Uploader and Secondly if you have already saved Json text file in a folder. In both way you can use above example to implement in your code.

 

Maximum Order Limit:


The maximum number of orders which can be created in single API call is 50 if more than fifty orders are uploaded the request will be denied (error code:03).

 

3.0 Get Paid Orders (JSON)

The details of the API are as under

 

API Signature

https://{Base URL Goes Here}/cpay/gpojson

 

HTTP Method

Get

 

Input Parameters

Given below are the mandatory parameters that will be used when calling above web API:

Parameter

Description

Data Type

username

PayPro client authentication id

String(60)

password

PayPro client authentication password

String(60)

startDate

Paid order’s Start Date

yyyy-MM-dd

endDate

Paid order’s End Date

yyyy-MM-dd

 

Usage with Parameters

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in JSON Format.

 

https://{Base URL Goes Here}/cpay/gpojson?username=PayPro&password= PayProi517&startDate=2017/01/01&endDate=2020/01/01

 

 

API Response with JSON format

In case of success when you got data from your input request you will get Json response in two sections. First will show you Status tag with it success code which are already described in details in Response codes section. See Ref 1.1 in below, and second will be the response result with Json that is described as under:

[

    {“Status”:”00”},

    {

        "Order Number""HR-100013",

        "Customer Email""abcd@paypro.com.pk",

        "Issue Date""2018-12-30T00:00:00",

        "Customer Mobile""03123456789",

        "Order Amount"45050,

        "Date Created""2018-12-27T15:04:25.923",

        "Order Due Date""2018-12-20T00:00:00",

        "Customer Address""ABCD Street",

        "Date Paid""2019-01-01T00:00:00",

        "ConnectPay Id""00391836100002",

        "Amount Paid"45050

    },

    {

        "Order Number""HR-100017",

        "Customer Email":  "abcd@paypro.com.pk",

        "Issue Date""2018-12-30T00:00:00",

        "Customer Mobile""03333473876",

        "Order Amount""45054",

        "Date Created""2019-01-01T10:12:43.72",

        "Order Due Date": "2018-12-20T00:00:00",

        "Customer Address""Abcd street",

        "Date Paid""2019-01-01T00:00:00",

        "ConnectPay Id""00391900100005",

        "Amount Paid""45054"

    },

    {

        "Order Number""HR-100018",

        "Customer Email""abcd@paypro.com.pk ",

        "Issue Date""2018-12-30T00:00:00",        

        "Customer Mobile""03123456789",

        "Order Amount""45055",

        "Date Created""2019-01-01T10:12:43.743",

        "Order Due Date""2018-12-20T00:00:00",

        "Customer Address""Abcd Street",

        "Date Paid""2019-01-01T00:00:00",

        "ConnectPay Id""00391900100006",

        "Amount Paid"45055

    }

]

 

Response codes with description

 

Ref: 1.1

Response Code

Description

00

Success

01

Invalid Data.

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

01

Invalid Data. Username or password is invalid

01

Invalid Data. Start Date should be less then to End Date

01

Invalid Data. Date format is invalid

01

Invalid Data. Date format is invalid

02

Service Failed. User is not Authorized for this service

03

No data available

 

4.0 Mark Order as Paid

 

API Signature

https://{Base URL Goes Here}/cpay/moap?csvOrders

 

HTTP Method

Get

 

Input Parameters

Given below is the mandatory parameter that will be used when calling above web API:

 

Parameter

Description

Data Type

Length

csvOrders

This parameter will contains json format with client’s credentials.

String

4000

 

JSON format of csvOrders is described as under

Parameter

Description

Data Type

Username

Connect pay client authentication id

String(60)

Password

Connect pay client authentication password

String(60)

CsvOrderNumbers

Comma separated orders number to  be mark as paid

String(4000)

 

 

Usage with Parameter

You can call this Web API via Postman (Testing API Tool) OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in Json Format.  If you provide single or multiple order numbers in CsvOrderNumbers parameter then your order(s) will be marked as paid.

 

Single Order

 

https://{Base URL Goes Here}/cpay/moap?csvOrders={"Username":"PayPro","password" :"PayProi517","CsvOrderNumbers" " Cpay-10942"}

 

 

 

Multiple Orders

 

https://{Base URL Goes Here}/cpay/moap?csvOrders={"Username":"PayPro","password":"PayProi517","CsvOrderNumbers" "Cpay-10942,CPay-1011"}

 

JSON Format for Calling Web API

{

"Username" : "PayPro",

"Password":" PayPro",

"CsvOrderNumbers""Cpay-10942"

}

 

API Response with JSON format:

In case of success when you got data from your input request in csvOrders then you will get JSON response in only one section which is described as under:

 [{"Status":"00"}]

 

In case of failure you will get the following JSON Format:

If you provide single order number then you will get single detail of that order number otherwise in case of csv orders you will get multiple order details of your provided csv orders number in JSON format.

 

[

{"Status":"01"},

{"OrderNumber":"PayPro1001”,"OrderStatus":"Block,"ConnectPayId":"00441903501505"},

{"OrderNumber":" PayPro1002”,"OrderStatus":"Block,"ConnectPayId":"00441903501502"}

]

 

 

Response codes with description

Response Code

Description

00

Success

01

Invalid Data.

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

01

Error in updating record

01

You can update only unpaid orders to mark Paid

02

Service Failed. User is not Authorized for this service

03

No data available

 

 

5.0 Mark Order as Blocked

 

API Signature           

https://{Base URL Goes Here}/cpay/moab?csvOrders

 

HTTP Method          

Get

 

Input Parameters

Given below is the mandatory parameter that will be used when calling above web api

Parameter

Description

Data Type

Length

csvOrders

This parameter will contains json format with client’s credentials.

String

4000

 

Json format of csvOrders is described as under

Parameter

Description

Data Type

Username

Connect pay client authentication id

String(60)

Password

Connect pay client authentication password

String(60)

CsvOrderNumbers

Comma separated orders number to  be mark as paid

String(4000)

 

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in Json Format.  If you provide single or multiple order numbrs in CsvOrderNumbers  param then  your order(s) will be marked as paid.

 

Single Order

 

https://{Base URL Goes Here}/cpay/moab?csvOrders={"Username" : "PayPro","password" :" PayProi517" ,"CsvOrderNumbers" "Cpay-10942"}

 

 

Multiple Orders

 

https://{Base URL Goes Here}/cpay/moab?csvOrders={"Username": "PayPro","password":"PayProi517","CsvOrderNumbers" "Cpay-10942,CPay-1011"}

 

JSON Format for Calling Web API

{

"Username":"PayPro",

"Password":"PayProi517",

"CsvOrderNumbers""Cpay-10942"

}

 

 

API Response with JSON format

In case of success when you got data from your input request in csvOrders then you will get Json response in only one section which is described as under:

 [{"Status":"00"}]

 

In case of failure you will get the following JSON Format:

If you provide single order number then you will get single detail of that order number otherwise in case of csv orders you will get multiple order details of your provided csv orders number in Json format.

 

[

{"Status":"01"},

{"OrderNumber":"PayPro1001”,"OrderStatus":"Paid,"ConnectPayId":"00441903501505"},

{"OrderNumber":"PayPro1002”,"OrderStatus":"Paid,"ConnectPayId":"00441903501502"}]

 

 

Response codes with description

Response Code

Description

00

Success

01

Invalid Data.

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

01

Error in updating record

01

You can update only unpaid orders to mark Blocked

02

Service Failed. User is not Authorized for this service

03

No data available

 

 

 

6.0 Mark Order as Refund

 

API Signature

https://{Base URL Goes Here}/cpay/mofr?csvOrders

 

HTTP Method

Get

 

Input Parameters

Given below is the mandatory parameter that will be used when calling above web API:

Parameter

Description

Data Type

Length

csvOrders

This parameter will contains json format with client’s credentials.

String

4000

 

Json format of csvOrders is described as under

Parameter

Description

Data Type

Username

Connect pay client authentication id

String(60)

Password

Connect pay client authentication password

String(60)

CsvOrderNumbers

Combination of Order Number and Amount separated with comma. Provide more Orders separated with Pipe

String(4000)

 

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. When you will call this API via Programming then you will get Response in Json Format.   If you provide single or multiple order numbers in CsvOrderNumbers param then your order(s) will be marked as refund.

 

Single Order

 

https://{Base URL Goes Here}/cpay/mofr?csvOrders={"Username":"PayProUser","Password":"p@ssw0rd","CsvOrderNumbers" : "89063-3,450|"}

 

 

Multiple Order

 

https://{Base URL Goes Here}/cpay/mofr?csvOrders={"Username":"PayPro","Password":"P@ssw0rd","CsvOrderNumbers" : "HR-100178,450|KV-1011,450"}

 

 

JSON Format for Calling Web API

{

"Username":"PayPro",

"Password":" PayProi517",

"CsvOrderNumbers""HR-100178,450|KV-1011,450"

}

 

 

API Response with JSON format

In case of success when you got data from your input request in csvOrders then you will get Json response in only one section which is described as under:

 [{"Status":"00"}]

 

In case of failure you will get the following JSON Format

If you provide single order number then you will get single detail of that order number otherwise in case of csv orders you will get multiple order details of your provided csv orders number in Json format.

 

[{"Status":"01"},

{"OrderNumber":"PayPro1001”,"OrderStatus":"Blocked”,"ConnectPayId":"00441903501505"},

{"OrderNumber":"PayPro1002”,"OrderStatus":"Already Refunded”,"ConnectPayId":"00441903501502"}]

Response codes with description:

Response Code

Description

00

Success

01

Invalid Data.

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

01

Error in updating record

01

You can update only unpaid orders to mark Refund

02

Service Failed. User is not Authorized for this service

03

No data available

 

7.0 Get Order Status

API Signature

https://{Base URL Goes Here}/cpay/gos

 

HTTP Method          

Get

 

Input Parameters

Given below is the mandatory parameter that will be used when calling above web API:

Json format is described as under

Parameter

Description

Data Type

Username

Connect pay client authentication id

String(60)

Password

Connect pay client authentication password

String(60)

cpayId

PayPro Id

String(32)

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in Json Format.  If you provide PayPro/Connectpay ID Order’s status will be returned.

 

https:// {Base URL Goes Here}/cpay/gos?userName=ConnectPay&password=p@ssw0rd&cpayId=00471910900006

 

API Response with JSON format

In case of success you will get the order status in return

[

    {

                "Status""00"

    },

    {

               "OrderStatus""Blocked"

               "OrderAmountPaid"0.0000,

              "DatePaid"null,

              "OrderNumber""OpenCart115322"

    }

]

 

 

Response codes with description

Response Code

Description

00

Success

01

Invalid Data.

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

02

Service Failed. User is not Authorized for this service

03

No data available

8.0 Add Consumer

 

API Signature

https://{Base URL Goes Here}/cpay/cc?oJson

 

HTTP Method          

Post

 

Input Parameters

Given below are parameters that will be used when calling above web api:

JSON format is described as under

Parameter

Description

Mandatory/Optional

Data Type

MerchantId

PayPro pay client authentication id

M

String(60)

MerchantPassword

PayPro pay client authentication password

M

String(60)

ConsumerID

Consumer ID which needs to be added in to the consumer list

M

String(4000)

Name

Consumer Name

M

String(1000)

Mobile

Consumer Mobile Number

O

String(1000)

Email

Consumer Email Address

O

String(1000)

Address

Consumer Address

O

String(1000)

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in JSON Format.  If you provide All Required Parameters Consumer added message will be returned with success status.

 

https:// {Base URL Goes Here}/cpay/cc?oJson=[{"MerchantId":"MerchantUsername","MerchantPassword":"your password"},{"ConsumerID":"123456780","Name":"Usman","Mobile":"03123456789","Email":"abcd@paypro.com.pk","Address":""}]

 

API Response with JSON format

In case of success you will get the order status in return

[

    {

        "Status""00"

    },

    {

        "FullConsumerCode""0044123456780",

        "Description""Consumer number created successfully",

        "ConsumerNumber"123456780

    }

]

 

Response codes with description

Response Code

Description

00

Success

01

Consumer Already Exist

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

02

Service Failed. User is not Authorized for this service

03

No data available

 

9.0 Add Multiple Consumer

 

API Signature

https://{Base URL Goes Here}/cpay/cmc?oJson

 

HTTP Method          

Post

 

Input Parameters

Given below are parameters that will be used when calling above web API:

Object will be sent as text file with JSON format is described as under:

Parameter

Description

Mandatory/Optional

Data Type

MerchantId

PayPro client authentication id

M

String(60)

MerchantPassword

PayPro client authentication password

M

String(60)

ConsumerID

Consumer ID which needs to be added in to the consumer list

M

String(4000)

Name

Consumer Name

M

String(1000)

Mobile

Consumer Mobile Number

O

String(1000)

Email

Consumer Email Address

O

String(1000)

Address

Consumer Address

O

String(1000)

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in JSON Format.  If you provide All Required Parameters Consumer added message will be returned with success status.

 

https://{Base URL Goes Here}/cpay/cmc

 

JSON object sample (create multiple consumers):

[

{

    "MerchantId":"Your Username",

    "MerchantPassword":"Your Password"

},

{

    "ConsumerID":"123456785",

    "Name":"User",

    "Mobile":"03123456789",

    "Email":"abcd@paypro.com.pk",

    "Address":""

   },

{

    "ConsumerID":"123456786",

    "Name":"User 2",

    "Mobile":"03123456788",

    "Email":"abcd2@paypro.com.pk",

    "Address":""

   }

]

 

API Response with JSON format

In case of success you will get the order status in return

[

    {

        "Status""00"

    },

    {

        "FullConsumerCode""0110123456785",

        "Description""Consumer number 123456785 created successfully",

        "ConsumerNumber""123456785"

    },

    {

        "FullConsumerCode""0110123456786",

        "Description""Consumer number 123456786 created successfully",

        "ConsumerNumber""123456786"

    }

]

 

Response codes with description

Response Code

Description

00

Success

01

Consumer Already Exist

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

02

Service Failed. User is not Authorized for this service

03

No data available

 

 

10.0 Update Consumer

 

API Signature

https://{Base URL Goes Here}/cpay/uc?oJson

 

HTTP Method:          

Post

 

Input Parameters:

Given below are parameters that will be used when calling above web API:

JSON format is described as under:

Parameter

Description

Mandatory/Optional

Data Type

MerchantId

PayPro pay client authentication id

M

String(60)

MerchantPassword

PayPro pay client authentication password

M

String(60)

ConsumerID

Full Consumer ID including Company Code/Biller ID

M

String(4000)

Name

Consumer Name

O

String(1000)

Mobile

Consumer Mobile Number

O

String(1000)

Email

Consumer Email Address

O

String(1000)

Address

Consumer Address

O

String(1000)

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in JSON Format.  If you provide All Required Parameters Consumer updated successfully message will be returned with success status.

 

https:// {Base URL Goes Here}/cpay/uc?oJson=[{"MerchantId":"MerchantUsername","MerchantPassword":"your password"},{"ConsumerID":"0040123456780","Name":"Usman","Mobile":"03123456789","Email":"abcd@paypro.com.pk","Address":""}]

 

API Response with JSON format

In case of success you will get the order status in return

[

    {

        "Status""00"

    },

    {

        "Description""ConsumerID 0040123456780 updated successfully",

        "ConsumerID""0040123456780"

    }

]

 

 

Response codes with description

Response Code

Description

00

Success

01

Consumer Already Exist

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

02

Service Failed. User is not Authorized for this service

03

No data available

 

11.0 Update Multiple Consumers

 

API Signature

https://{Base URL Goes Here}/cpay/umc?oJson

 

HTTP Method          

Post

 

Input Parameters

Given below are parameters that will be used when calling above web API:

Object will be sent as text file with JSON format is described as under:

Parameter

Description

Mandatory/Optional

Data Type

MerchantId

PayPro pay client authentication id

M

String(60)

MerchantPassword

PayPro pay client authentication password

M

String(60)

ConsumerID

Consumer ID which needs to be added in to the consumer list

M

String(4000)

Name

Consumer Name

O

String(1000)

Mobile

Consumer Mobile Number

O

String(1000)

Email

Consumer Email Address

O

String(1000)

Address

Consumer Address

O

String(1000)

 

Usage with Parameter

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in JSON Format.  If you provide All Required Parameters Consumer added message will be returned with success status.

 

https:// {Base URL Goes Here}/cpay/umc

 

JSON object sample (update multiple consumers):

[

{

        "MerchantId":"Your Username",

        "MerchantPassword":"Your Password"

},

{

    "ConsumerID":"123456785",

    "Name":"User",

    "Mobile":"03123456789",

    "Email":"abcd@paypro.com.pk",

    "Address":""

   },

{

    "ConsumerID":"123456786",

    "Name":"User 2",

    "Mobile":"03123456788",

    "Email":"abcd2@paypro.com.pk",

    "Address":""

   }

]

 

API Response with JSON format

In case of success you will get the order status in return

[

    {

        "Status""00"

    },

    {

        "Description""ConsumerID 0110123456785 updated successfully",

        "ConsumerID""0110123456785"

    },

    {

        "Description""ConsumerID 0110123456786 updated successfully",

        "ConsumerID""0110123456786"

    }

]

 

Response codes with description

Response Code

Description

00

Success

01

Consumer Already Exist

02

User not Authorized.

03

No Records Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

02

Service Failed. User is not Authorized for this service

03

No data available

 

12.0 Get Consumer Data

 

API Signature           

https://{Base URL Goes Here}/cpay/gcd

 

HTTP Method          

Get

 

Input Parameters

Given below are parameter that will be used when calling above web API:

JSON format is described as under:

Parameter

Description

Data Type

MerchantId

PayPro pay client authentication id

String(60)

MerchantPassword

PayPro pay client authentication password

String(60)

ConsumerID

Full Consumer ID including Company Code/Biller ID

String(60)

 

Usage with Parameter:

You can call this Web API via API Testing Tool OR you can use below API Calling Signature from your browser URL. Keep in mind when you will call this API via Programming then you will get Response in JSON Format.  If you provide All Required Parameters Consumer updated successfully message will be returned with success status.

 

https://{Base URL Goes Here}/cpay/gcd?userName=Username&password=YourPassword& fullConsumerCode =00441234567

API Response with JSON format

In case of success you will get the order status in return

[

    {

        "Description""Record fetched successfully",

        "Status""00"

    },

    {

        "FullConsumerCode""00441234567",

        "CreatedOn""2020-06-10T10:17:45.247",

        "Email""abcd@paypro.com.pk",

        "ConsumerCode""1234567",

        "Address""ABCD",

        "Mobile""03123456789",

        "CompanyCode""0044",

        "Name""User"

    }

]

 

Response codes with description

Response Code

Description

00

Success

01

Invalid Info

02

User not Authorized.

03

No Data Found

 

All Possible error description with their codes

Status

Description

01

Invalid Format

01

Invalid Data. Username cannot be empty

01

Invalid Data. Username length is invalid

01

Invalid Data. Password cannot be empty

01

Invalid Data. Password length is invalid

01

Invalid Data. Username or password is invalid

02

Service Failed. User is not Authorized for this service

03

No data available