Payguru UK Projects API Documentation

Subscription

Subscription - generate-pin

In Wi-Fi flow, PAYGURU will generate a PIN and deliver it via SMS to USER after USER provide MSISDN and Operator information. PINs generated by PAYGURU has an experiation period of 10 minutes.

/generate-pin

Parameters

Field Type Description
authorization String | Required

Authorization Key

merchant Integer | Required

Merchant ID

product Integer | Required

Product ID

operator Integer | Required

User Operator

msisdn String | Required

User MSISDN

userip String | Required

User IP

tracking_id String | Required

Tracking ID

curl -d "authorization=&merchant=&product=&userip=&msisdn=&operator=&tracking_id=" "http://uk.payguru.com/landings/api/generate-pin"
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/generate-pin";
curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "authorization=&merchant=&product=&userip=&msisdn=&operator=&tracking_id=",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}
curl -X GET "http://uk.payguru.com/landings/api/generate-pin?authorization=&merchant=&product=&userip=&msisdn=&operator=&tracking_id="
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/generate-pin";
$data = [
    "authorization"=>"",
    "merchant"=>"",
    "product"=>"",
    "userip"=>"",
    "msisdn"=>"",
    "operator"=>"",
    "tracking_id"=>"",
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}

Success

Field Type Description
status String

Status Code: 000 #See

description String

Description

Error

Field Type Description
status String

Status Code #See

description String

Description

{
    "status": "000",
    "description": "Request Successfully."
}
{
    status :  "029",
    description :  "Invalid Authorization"
}

Send a Sample Request Hide Show

URL

Parameters

String
Integer
Integer
Integer
String
String
String

Subscription - subscription-request

In Wi-Fi or One-Click Flow, USER shall give approval in order the subscription to start. In Wi-Fi flow, MSISDN, Operator and PIN parameters are mandatory fields. In One-Click Flow, token information is a mandatory field.

/subscription-request

Parameters

Field Type Description
authorization String | Required

Authorization Key

merchant Integer | Required

Merchant ID

product Integer | Required

Product ID

userip String | Required

User IP

tracking_id String | Required

Tracking ID

token Integer

Msisdn Token

operator Integer

User Operator

msisdn String

User MSISDN

pin String

PIN

curl -d "authorization=&merchant=&product=&userip=&token=&msisdn=&operator=&pin=&tracking_id=" "http://uk.payguru.com/landings/api/subscription-request"
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/subscription-request";
curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "authorization=&merchant=&product=&userip=&token=&msisdn=&operator=&pin=&tracking_id=",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}
curl -X GET "http://uk.payguru.com/landings/api/subscription-request?authorization=&merchant=&product=&userip=&msisdn=&operator=&pin=&tracking_id="
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/subscription-request";
$data = [
    "authorization"=>"",
    "merchant"=>"",
    "product"=>"",
    "userip"=>"",
    "msisdn"=>"",
    "operator"=>"",
    "pin"=>"",
    "tracking_id"=>"",
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}

Success

Field Type Description
status String

Status Code: 000 #See

description String

Description

Error

Field Type Description
status String

Status Code #See

description String

Description

{
    "status": "000",
    "description": "Request Successfully."
}
{
    status :  "029",
    description :  "Invalid Authorization"
}

Send a Sample Request Hide Show

URL

Parameters

String
Integer
Integer
String
String
Integer
Integer
String
String

Subscription - cancel-subscription

Cancel Subscription shall be used for ending USER’s or PORTAL ADMINISTOR’s active subscription from MERCHANT’s portal. In order to use this service, ONE should have a SUBSCRIPTION ID that is provided by PAYGURU.

/cancel-subscription

Parameters

Field Type Description
authorization String | Required

Authorization Key

merchant Integer | Required

Merchant ID

subscription Integer | Required

Subscription ID

curl -d "authorization=&merchant=&subscription=" "http://uk.payguru.com/landings/api/cancel-subscription"
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/cancel-subscription";
curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "authorization=&merchant=&subscription=",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}
curl -X GET "http://uk.payguru.com/landings/api/cancel-subscription?authorization=&merchant=&subscription="
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/cancel-subscription";
$data = [
    "authorization"=>"",
    "merchant"=>"",
    "subscription"=>"",
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}

Success

Field Type Description
status String

Status Code: 000 #See

description String

Description

subscription Array

Subscription Detail

  -id String

Id

  -status String

Status

  -subscription_date String

Subscription date(Format: Y-m-d H:i:sT)

  -cancellation_date String

Cancellation date(Format: Y-m-d H:i:sT)

  -renewal_date String

Renewal date(Format: Y-m-d H:i:sT)

  -cancellation_source String

Cancellation source

  -product String

Product

Error

Field Type Description
status String

Status Code #See

description String

Description

{
    "status": "000",
    "description": "Request Successfully.",
    "subscription": {
        "id": 12345,
        "product": 123,
        "status": "cancelled",
        "subscription_date": "2017-03-30 15:16:51+03",
        "renewal_date": "2017-04-07 16:15:50+03",
        "cancellation_date": "2017-04-04 11:14:58+03",
        "cancellation_source": "MI"
    }
}
{
    status :  "029",
    description :  "Invalid Authorization"
}

Send a Sample Request Hide Show

URL

Parameters

String
Integer
Integer

Subscription - get-msisdn

In One-Click Flow, MSISDN and Operator information will be shared upon request corresponding to token information.

/get-msisdn

Parameters

Field Type Description
authorization String | Required

Authorization Key

merchant Integer | Required

Merchant ID

token String | Required

Msisdn Token

curl -d "authorization=&merchant=&token=" "http://uk.payguru.com/landings/api/get-msisdn"
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/get-msisdn";
curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "authorization=&merchant=&token=",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo o["msisdn"];
  }else{
      echo $o["message"];
  }
}
curl -X GET "http://uk.payguru.com/landings/api/get-msisdn?authorization=&merchant=&token="
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/get-msisdn";
$data = [
    "authorization"=>"",
    "merchant"=>"",
    "subscription"=>"",
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo o["msisdn"];
  }else{
      echo $o["message"];
  }
}

Success

Field Type Description
status String

Status Code: 000 #See

description String

Description

msisdn String

Msisdn

operator Integer

Operator #See

Error

Field Type Description
status String

Status Code #See

description String

Description

{
    "status": "000",
    "description": "Request Successfully.",
    "msisdn": "44123456789",
    "operator": 123
}
{
    status :  "029",
    description :  "Invalid Authorization"
}

Send a Sample Request Hide Show

URL

Parameters

String
Integer
String

User Activity

User Activity

User Activity - add-user-activity

This service will be used for keeping log records of USER ACTIVITY. For the first visit of the page requires “tracking_id” and url, userip, browser, referer fields are mandatory to fill for “visit” type.

/user-activity

Parameters

Field Type Description
authorization String | Required

Authorization Key

merchant Integer | Required

Merchant ID

product Integer | Required

Product ID

tracking_id String | Required

Tracking ID

type String | Required

Type #See

url String

Request URI

userip String

User IP

browser String

Browser

referer String

Referer

curl -d "authorization=&merchant=&product=&tracking_id=&type=visit&url=&userip=&browser=&referer=" "http://uk.payguru.com/landings/api/user-activity"
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/user-activity";
curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "authorization=&merchant=&product=&tracking_id=&type=visit&url=&userip=&browser=&referer=",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}
curl -X GET "http://uk.payguru.com/landings/api/user-activity?authorization=&merchant=&product=&tracking_id=&type=visit&url=&userip=&browser=&referer="
<?php
$curl = curl_init();
$url = "http://uk.payguru.com/landings/api/user-activity";
$data = [
    "authorization"=>"",
    "merchant"=>"",
    "subscription"=>"",
];
curl_setopt_array($curl, array(
  CURLOPT_URL => $url."?".http_build_query($data),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $o = json_decode($response,true);
  if($o["status"] == "000"){
      echo "OK";
  }else{
      echo $o["message"];
  }
}

Success

Field Type Description
status String

Status Code: 000 #See

description String

Description

Error

Field Type Description
status String

Status Code #See

description String

Description

{
    "status": "000",
    "description": "Request Successfully."
}
{
    status :  "029",
    description :  "Invalid Authorization"
}

Send a Sample Request Hide Show

URL

Parameters

String
Integer
Integer
String
String
String
String
String
String

Definations

Status Codes

Status Description
400 Missing Parameter
000 Request Successfully.
001 Landing Page Not Found.
002 Failed To Get Subscribed.
003 Pin Is Out Of Time.
004 Invalid Phone Number.
005 Internal System Error.
006 Invalid Operator.
007 Phone Number Is In Blacklist.
018 Billing Cap Has Been Reached. Please Try Again Later.
019 The daily billing cap for this MSISDN has been reached.
020 Your Phone Number Has Already An Active Subscription.
021 Landing in test mode
025 Missing Parameter(s)
026 Invalid Request
027 Invalid Token
028 Invalid Pin
029 Invalid Authorization
030 IP address not allowed
031 Subscription not found
032 Subscription has been already cancelled
033 Subscription status is not available for cancellation

Types

Type Description
visit Visit
subscribe_clicked Subscribe Clicked
confirm_clicked Confirm Clicked

Operators

ID Name
1 EE
2 Orange
3 T-Mobile
4 O2
5 Swisscom
6 Du
7 Etisalat