Market Place
Get Vendor Form Url
Üye işyeri hesabına bağlı alt üye işyeri ekleme formunun url adresini oluşturan servistir. Üye işyerleri bu servis aracılığıyla elde ettikleri redirectUrl i kendi platformlarında iframe içinde kullanabilirler. redirectUrl üzerinde gerçekleşen kayıt işlemi sonucuna göre kullanıcı, success_url veya failure_url adreslerine geri yönlendirilmektedir.
>URL
https://api.payguru.com/phs/marketPlace/get-vendor-form-url
>HTTP Method
GET yada POST
>Headers
Field | Type | Description |
---|
merchant | Integer - Required | Merchant ID |
token | String - Required | Token |
>Parameters
Field | Type | Description |
---|
code | String - Required | Service Code |
vendor_code | String - Unique - Required | Merchant Vendor Code |
name | String - Required | Vendor Name |
tc_no | Integer - Optional | Vendor TC No |
phone | String - Required | Vendor Mobile Phone Number |
email | String - Optional | Vendor E-mail |
iban | String - Required | Vendor Iban |
success_url | String - Required | For success redirection |
failure_url | String - Required | For failure redirection |
>Success
Field | Type | Description |
---|
status | String | Status Code: 000 |
message | String | Message |
redirectUrl | String | Vendor Form Url |
>Error
Field | Type | Description |
---|
status | String | Status Code: #See |
message | String | Message |
>Örnek Cevaplar
{
"status": "000",
"message": "Success",
"redirectUrl": "https://api.payguru.com/phs/marketPlace/getVendorForm?token=123-B03A6649-1FF7-0CBE-0786-779CF683827D"
}
{
"status": "ERR_005",
"message": "Invalid Service"
}
>Örnek Kodlar
curl -X GET -H "token: {3E53E639-5173-D1B6-9368-68FCBCF72342}" -H "merchant: 123" --globoff "https://api.payguru.com/phs/marketPlace/get-vendor-form-url?code=Service%20Code&name=Vendor%20Name%20Surname&vendor_code=VENDOR_1&tc_no=11111111111&phone=5321234567&email=vendor1@merchant.com&successUrl=http%3A%2F%2Fwww.merchantservice.com%2Fsuccess&failureUrl=http%3A%2F%2Fwww.merchantservice.com%2Ffailure&iban=TR330006100519786457841326"
<?php
$curl = curl_init();
$url = "https://api.payguru.com/phs/marketPlace/get-vendor-form-url";
$headers = [
"token: {3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant: 123"
];
$data = array(
'code' => 'Service Code',
'name' => 'Vendor Name Surname',
'vendor_code' => 'VENDOR_1',
'tc_no' => '11111111111',
'phone' => '5321234567',
'email' => 'vendor1@merchant.com',
'successUrl' => 'http://www.merchantservice.com/success',
'failureUrl' => 'http://www.merchantservice.com/failure',
'iban' => 'TR330006100519786457841326'
);
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)["redirectUrl"];
}
var client = new RestClient("https://api.payguru.com/phs/marketPlace/get-vendor-form-url?code=Service%20Code&name=Vendor%20Name%20Surname&vendor_code=VENDOR_1&tc_no=11111111111&phone=5321234567&email=vendor1@merchant.com&successUrl=http%3A%2F%2Fwww.merchantservice.com%2Fsuccess&failureUrl=http%3A%2F%2Fwww.merchantservice.com%2Ffailure&iban=TR330006100519786457841326");
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["redirectUrl"]);
} else {
MessageBox.Show((string)o["message"]);
}
import requests,json
url = "https://api.payguru.com/phs/marketPlace/get-vendor-form-url"
querystring = {"code":"Service Code","name":"Vendor Name Surname","vendor_code":"VENDOR_1","tc_no":"11111111111","phone":"5321234567","email":"vendor1@merchant.com","successUrl":"http://www.merchantservice.com/success","failureUrl":"http://www.merchantservice.com/failure","iban":"TR330006100519786457841326"}
headers = {
"token": "{3E53E639-5173-D1B6-9368-68FCBCF72342}",
"merchant": "123"
}
response = requests.request("GET", url, params=querystring)
if response.status_code == 200:
o = json.loads(response.text)
if o["status"] == "000":
print o["redirectUrl"]
else:
print o["message"]
else:
print "Request Error"