Order Lookup
Those are the services to be used in the scenarios when the merchant wants to share a separate shopping order in its system as an identifier for the payment. The merchant may trigger an order code generation process in the Payguru Platform for each shopping order in its system or may push its shopping order as an order code by using those services. Those services brings flexibility to the merchant in order to create a smooth shopping and purchasing experience for their customers by providing them a single "code" for both the payment and purchase.
Check
It is the service that queries whether a particular transaction code is registered in Payguru Platform.
>URL
https://api.payguru.com/phs/orderToReference/check
>HTTP Method
GET or POST
>Headers
Field | Type | Description |
---|
merchant | Integer - Required | Merchant ID |
token | String - Required | Token |
>Parameters
Field | Type | Description |
---|
code | String - Required | Service Code |
order | String - Required | Merchant Order |
>Success
Field | Type | Description |
---|
status | String | Status Code: 000 |
message | String | Message |
order | String | Payguru Order |
payout | String | For Market Place |
sub_merchant_id | String | For Market Place |
fee | Amount | For Market Place |
>Error
Field | Type | Description |
---|
status | String | Status Code: #See |
message | String | Message |
>Response Examples
{
"status": "000",
"message": "Success",
"order": "123412345678"
}
{
"status": "ERR_005",
"message": "Invalid Service"
}
>Sample Codes
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/orderToReference/check?code=XXX&order=ORDER"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/orderToReference/check";
$data = [
"code" => "XXX",
"order" => "ORDER",
];
$headers = [
"token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant: 123"
];
curl_setopt_array($curl, array(
CURLOPT_URL => $url."?".http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo json_decode($response,true)["order"];
}
var client = new RestClient("https://api.payguru.com/phs/orderToReference/check?code=XXX&order=ORDER");
var request = new RestRequest(Method.GET);
request.AddHeader("merchant", "123");
request.AddHeader("token", "{3E53E639-5173-D1B6-9368-68FCBCF72342}");
IRestResponse response = client.Execute(request);
var o = JObject.Parse(response);
if (o["status"] == "000") {
MessageBox.Show((string)o["order"]);
} else {
MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/orderToReference/check"
querystring = {"code":"XXX","order":"ORDER"}
headers = {
"token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant": "123"
}
response = requests.request("GET", url, headers=headers, params=querystring)
if response.status_code == 200:
o = json.loads(response.text)
if o["status"] == "000":
print o["order"]
else:
print o["message"]
else:
print "Request Error"
Create
It is the web service for the merchant to create an order code into the Payguru Platforms.
>URL
https://api.payguru.com/phs/orderToReference/create
>HTTP Method
GET or POST
>Headers
Field | Type | Description |
---|
merchant | Integer - Required | Merchant ID |
token | String - Required | Token |
>Parameters
Field | Type | Description |
---|
code | String - Required | Service Code |
amount | String - Required | Amount |
order | String - Required | Merchant Order |
payout | String - Optionally | Required For Market Place |
sub_merchant_id | Integer - Optionally | Required For Market Place |
fee | Amount - Optionally | Required For Market Place |
user_id | String - Optionally | Max:32 |
>Success
Field | Type | Description |
---|
status | String | Status Code: 000 |
message | String | Message |
order | String | Payguru Order |
>Error
Field | Type | Description |
---|
status | String | Status Code: #See |
message | String | Message |
>Respone Examples
{
"status": "000",
"message": "Success",
"order": "123412345678",
}
{
"status": "ERR_005",
"message": "Invalid Service"
}
>Sample Codes
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/orderToReference/create?code=XXX&order=ORDER&amount=1.00"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/orderToReference/create";
$data = [
"code"=>"XXX",
"order"=>"ORDER",
"amount"=>"1.00",
];
$headers = [
"token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant: 123"
];
curl_setopt_array($curl, array(
CURLOPT_URL => $url."?".http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo json_decode($response,true)["order"];
}
var client = new RestClient("https://api.payguru.com/phs/orderToReference/create?code=XXX&order=ORDER&amount=1.00");
var request = new RestRequest(Method.GET);
request.AddHeader("merchant", "123");
request.AddHeader("token", "{3E53E639-5173-D1B6-9368-68FCBCF72342}");
IRestResponse response = client.Execute(request);
var o = JObject.Parse(response);
if (o["status"] == "000") {
MessageBox.Show((string)o["order"]);
} else {
MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/orderToReference/create"
querystring = {"code":"XXX", "order":"ORDER", "amount":"1.00"}
headers = {
"token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant": "123"
}
response = requests.request("GET", url, headers=headers, params=querystring)
if response.status_code == 200:
o = json.loads(response.text)
if o["status"] == "000":
print o["order"]
else:
print o["message"]
else:
print "Request Error"
Direct
This is the service to be used by the merchant when all the information related to the payment is being delivered by Payguru Payment Page, not the merchant interface. Merchant calls this service in order to invoke the Payguru Payment Page where the order code is shared with the customer.
>URL
https://api.payguru.com/phs/orderToReference/direct
>HTTP Method
GET or POST
>Headers
Field | Type | Description |
---|
merchant | Integer - Required | Merchant ID |
token | String - Required | Token |
>Parameters
Field | Type | Description |
---|
code | String - Required | Service Code |
amount | String - Required | Amount |
order | String - Required | Merchant Order |
payout | String - Optionally | Required For Market Place |
sub_merchant_id | Integer - Optionally | Required For Market Place |
fee | Amount - Optionally | Required For Market Place |
user_id | String - Optionally | Max:32 |
PaymentNotification | Array[] | PaymentNotification Fields |
-tc_no | String | TCKN |
-name | String | Name |
-email | String | Email |
-phone | String | Mobile Phone |
-user_ip | String | User IP |
-apply_time | Date | Apply Time Format:YYYY-MM-DD HH:II:SS |
-description | String | Description |
>Success
Field | Type | Description |
---|
status | String | Status Code: 000 |
message | String | Message |
code | String | Payguru Order |
Please forward to "https://cp.payguru.com/phs/banks/{CODE}?redirect=SUCCESS_URL&backUrl=BACK_URL" with the code in response.
Redirect parameters are optional
>Error
Field | Type | Description |
---|
status | String | Status Code: #See |
message | String | Message |
>Response Examples
{
"status": "000",
"message": "Success",
"code": "123412345678",
}
{
"status": "ERR_005",
"message": "Invalid Service"
}
>Sample Codes
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/orderToReference/direct?code=XXX&order=ORDER&amount=1.00"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/orderToReference/direct";
$data = [
"code"=>"XXX",
"order"=>"ORDER",
"amount"=>"1.00",
];
$headers = [
"token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant: 123"
];
curl_setopt_array($curl, array(
CURLOPT_URL => $url."?".http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo json_decode($response,true)["code"];
}
var client = new RestClient("https://api.payguru.com/phs/orderToReference/direct?code=XXX&order=ORDER&amount=1.00");
var request = new RestRequest(Method.GET);
request.AddHeader("merchant", "123");
request.AddHeader("token", "{3E53E639-5173-D1B6-9368-68FCBCF72342}");
IRestResponse response = client.Execute(request);
var o = JObject.Parse(response);
if (o["status"] == "000") {
MessageBox.Show((string)o["code"]);
} else {
MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/orderToReference/direct"
querystring = {"code":"XXX", "order":"ORDER", "amount"=>"1.00"}
headers = {
"token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant": "123"
}
response = requests.request("GET", url, headers=headers, params=querystring)
if response.status_code == 200:
o = json.loads(response.text)
if o["status"] == "000":
print o["code"]
else:
print o["message"]
else:
print "Request Error"
Update
>URL
https://api.payguru.com/phs/orderToReference/update
>HTTP Method
GET or POST
>Headers
Field | Type | Description |
---|
merchant | Integer - Required | Merchant ID |
token | String - Required | Token |
>Parameters
Field | Type | Description |
---|
code | String - Required | Service Code |
order | String - Required | Merchant Order |
amount | String - Required | Amount |
payout | String - Optionally | Required For Market Place |
sub_merchant_id | Integer - Optionally | Required For Market Place |
fee | Amount - Optionally | Required For Market Place |
>Success
Field | Type | Description |
---|
status | String | Status Code: 000 |
message | String | Message |
order | String | Payguru Order |
>Error
Field | Type | Description |
---|
status | String | Status Code: #See |
message | String | Message |
>Response Examples
{
"status": "000",
"message": "Success",
"order": "123412345678"
}
{
"status": "ERR_005",
"message": "Invalid Service"
}
{
"status": "000",
"message": "Success",
"order": "123412345678"
}
{
"status": "ERR_005",
"message": "Invalid Service"
}
>Sample Codes
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/orderToReference/update?code=XXX&order=ORDER&amount=1.00"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/orderToReference/update";
$data = [
"code" => "XXX",
"order" => "ORDER",
"amount" => "1.00",
];
$headers = [
"token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant: 123"
];
curl_setopt_array($curl, array(
CURLOPT_URL => $url."?".http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo json_decode($response,true)["order"];
}
var client = new RestClient("https://api.payguru.com/phs/orderToReference/update?code=XXX&order=ORDER&amount=1.00");
var request = new RestRequest(Method.GET);
request.AddHeader("merchant", "123");
request.AddHeader("token", "{3E53E639-5173-D1B6-9368-68FCBCF72342}");
IRestResponse response = client.Execute(request);
var o = JObject.Parse(response);
if (o["status"] == "000") {
MessageBox.Show((string)o["order"]);
} else {
MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/orderToReference/update"
querystring = {"code":"XXX","order":"ORDER","amount":"1.00"}
headers = {
"token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant": "123"
}
response = requests.request("GET", url, headers=headers, params=querystring)
if response.status_code == 200:
o = json.loads(response.text)
if o["status"] == "000":
print o["order"]
else:
print o["message"]
else:
print "Request Error"