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
FieldTypeDescription
merchantInteger - RequiredMerchant ID
tokenString - RequiredToken
>Parameters
FieldTypeDescription
codeString - RequiredService Code
vendor_codeString - Unique - RequiredMerchant Vendor Code
nameString - RequiredVendor Name
tc_noInteger - OptionalVendor TC No
phoneString - RequiredVendor Mobile Phone Number
emailString - OptionalVendor E-mail
ibanString - RequiredVendor Iban
success_urlString - RequiredFor success redirection
failure_urlString - RequiredFor failure redirection

>Success
FieldTypeDescription
statusStringStatus Code: 000
messageStringMessage
redirectUrlStringVendor Form Url

>Error
FieldTypeDescription
statusStringStatus Code: #See
messageStringMessage

>Ö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"