نمونه کُد و مستندات

کتابخانه‌های اختصاصی زبان‌های برنامه‌نویسی مختلف را آماده کردیم. اگر نیافتید، از ما بخواهید-

مفاهیم اولیه

مفاهیم اولیه

به مستندات فنی وندار خوش آمدید
وب سرویس‌های وندار به صورت REST در اختیار کاربران و همکاران تجاری ما قرار گرفته است.
لطفا قبل از ادامه به آدرس پایه سرویس ها و نکات روبرو توجه کنید.
دانلود مجموعه سرویس های وندار برای Postman

مدت زمان اعتبار توکن ها ۵ روز است
همواره به جای {business}نام انگلیسی کسب و کار جایگذاری شود.

درگاه پرداخت

مقدمه

اگر یـکـ فروشـگاه اینتــرنتی دارید و خدمات یا محـصولات رو در وب‌سـایت خودتون ارائه می‌کنـید، می‌تــونید از درگاه پرداخـت ونـدار استفاده کنید. اگر میزان فروشـتون در ماه بالا باشه، ما درگاه .پرداخـت اخـتصاصی هم بهتـون می‌دیم



ارسال اطلاعات

در مرحله اول شما می بایست پارامترهای موجود در جدول زیر رو با متد POST به آدرسی که مشخص شده ارسال کنید. به نوع داده ها و نام فیلد توجه کنید. در صورتی که برای فیلد شماره موبایل، شماره موبایل کاربر را به درگاه ارسال نمایید، بصورت اتوماتیک درگاه موبایلی نمایش داده می شود


آدرس تست درگاه


پارامترهای ورودی

Parameter Type Status Description
api_key string required

دریافتی از پنل کاربری شما که بعد از تایید درخواست درگاه صادر میشه API Key
test ای پی آی کی تست برابر است با

amount Integer required مبلغ تراکنش به صورت ریالی و بزرگتر یا مساوی 1000
callback_url String required باید با آدرس درگاه پرداخت تایید شده در وندار بر روی یک دامنه باشد
mobile_number String optional شماره موبایل (اختیاری، جهت نمایش کارت های خریدار به ایشان و نمایش درگاه موبایلی )
factorNumber String optional شماره فاکتور شما (اختیاری)
description String optional توضیحات (اختیاری، حداکثر 255 کاراکتر)

Example request:

curl --request POST \
--url https://vandar.io/api/ipg/send \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--cookie __cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362 \
--form api_key=API_KEY \
--form amount=10000 \
--form callback_url=https://dash.paperpiano.ir/callback \
--form mobile_number= \
--form factorNumber= \
--form description=
var client = new RestClient("https://vandar.io/api/ipg/send");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddCookie("__cfduid", "d59bce9bad3db5171daea67d5f088a1f01561364362");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://vandar.io/api/ipg/send"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cookie", "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362")
req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.post("https://vandar.io/api/ipg/send")
	.header("cookie", "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362")
	.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
	.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
	.asString();
var http = require("https");

var options = {
"method": "POST",
"hostname": "vandar.io",
"port": null,
"path": "/api/ipg/send",
"headers": {
"cookie": "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
"content-type": "multipart/form-data; boundary=---011000010111000001101001",
"content-length": "0"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n");
req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://vandar.io/api/ipg/send/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n",
CURLOPT_COOKIE => "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
CURLOPT_HTTPHEADER => array(
"content-type: multipart/form-data; boundary=---011000010111000001101001"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPSConnection("vandar.io")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

headers = {
'cookie': "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
'content-type': "multipart/form-data; boundary=---011000010111000001101001"
}

conn.request("POST", "/api/ipg/send", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://vandar.io/api/ipg/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["cookie"] = '__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "token": "Payment Token"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن callback_url الزامی است",
    "callback_url معتبر نیست",
    "وارد کردن amount الزامی است",
    "amount نباید کوچکتر از 1000 باشد",
    "amount باید عدد یا رشته‌ای از اعداد باشد"
  ]
}


انتقال

در صورتی که در مرحله ارسال دیتا، اطلاعات ارسالی صحیح باشه و دو مقدار status و token رو دریافت کرده باشید باید کاربر رو به شیوه زیر به درگاه ریدایرکت کنید. برای اینکار باید عددی که در مرحله اول در متغییر {token} دریافت کردید رو در اخر ادرس قرار بدید و کاربر رو به URL ایجاد شده ریدایرکت کنید تا بلافاصله کاربر به درگاه پرداخت هدایت بشه و سپس مرحله سوم رو انجام بدید.


آدرس تست درگاه

Example request:

$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}


بازگشت

مرحله سوم زمانی انجام میشه که کاربر از درگاه پرداخت بر میگرده. در این مرحله با توجه به نتیجه تراکنش و وضعیت اون، ما کاربر رو به آدرس کالبک شما که در مرحله اول با پارامتر redirect ارسال کرده بودید هدایت میکنیم.

Example request:

$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(verify($api,$token));
if(isset($result->status)){
	if($result->status == 1){
		echo "SUCCESS";
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}


تایید

مهم : درصورت موفقیت آمیز بودن تراکنش، با فراخوانی متد وریفای، هر بار پیام وریفای تراکنش اعلام می شود. برای پیشگیری از بروز تقلب پذیرنده باید قبل از ارائه محصول و خدمات با استفاده از شماره تراکنش شبکه پرداخت وندار ( همان transId ) از عدم وجود شماره تراکنش در بانک اطلاعاتی خود اطمینان حاصل کند سپس خدمات را به مشتری ارائه نماید.


آدرس تست درگاه

برای تست درگاه در این بخش کافیست که api_key را برابر با test قرار دهید و توکن دریافتی تستی در مرحله ارسال دیتا را به عنوان توکن ارسال کنید.

Example request:

function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}

Example response (200):

{
  "status": 1,
  "amount": "10000",
  "transId": 155058785697,
  "factorNumber": null,
  "mobile": null,
  "description": "description",
  "cardNumber": "603799******6299",
  "paymentDate": "2019-02-19 18:21:50",
  "message": "ok"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن token الزامی است",
    "token معتبر نیست",
    "نتیجه تراکنش قبلا از طرف وندار اعلام گردیده",
    "تراکنش با خطا مواجه شده است"
  ]
}


لیست درگاه‌های پرداخت

Example request:

curl --request GET \
--url https://basic_url/v2/business/{business}ipg/show \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("https://basic_url/v2/business/{business}ipg/show");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}ipg/show"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
var http = require("https");

var options = {
"method": "GET",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}ipg/show",
"headers": {
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
curl --request GET \
--url https://basic_url/v2/business/{business}/iban \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]'
curl --request GET \
--url https://basic_url/v2/business/{business}/iban \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]'
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = { 'authorization': "Bearer [TOKEN]" }

conn.request("GET", "/v2/business/{business}ipg/show", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}ipg/show")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "ipg": {
      "urls": [
        "https:\/\/test1.ui",
        "https:\/\/test2.market",
        "https:\/\/google.ws",
        "https:\/\/jesica.tv",
        "https:\/\/api.jesica.tv",
        "https:\/\/test.google.market"
      ],
      "ips": [
        "135.242.0.125"
      ],
      "api_key": "714e6f**************a9a2273243",
      "wage": false,
      "vip": true,
      "payment": false,
      "status": 1,
      "transactions_count": 23,
      "transactions_sum": 2604
    }
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


درگاه پرداخت دومرحله‌ای

مقدمه

اگر یـکـ فروشـگاه اینتــرنتی دارید و خدمات یا محـصولات رو در وب‌سـایت خودتون ارائه می‌کنـید، می‌تــونید از درگاه پرداخـت ونـدار استفاده کنید. اگر میزان فروشـتون در ماه بالا باشه، ما درگاه پرداخـت اخـتصاصی هم بهتـون می‌دیم



ارسال اطلاعات

در مرحله اول شما می بایست پارامترهای موجود در جدول زیر رو با متد POST به آدرسی که مشخص شده ارسال کنید. به نوع داده ها و نام فیلد توجه کنید. در صورتی که شماره موبایل کاربر ارسال گردد لیست شماره کارتهای ثبت شده برای این شماره موبایل در صفحه پرداخت نمایش داده می شود. نکته : تمامی داده های برگشتی از وندار به صورت json است


پارامترهای ورودی

Parameter Type Status Description
api_key string required

دریافتی از پنل کاربری شما که بعد از تایید درخواست درگاه صادر میشه API Key

amount Integer required مبلغ تراکنش به صورت ریالی و بزرگتر یا مساوی 1000
callback_url String required باید با آدرس درگاه پرداخت تایید شده در وندار بر روی یک دامنه باشد
mobile_number String optional شماره موبایل (اختیاری، جهت نمایش کارت های خریدار به ایشان و نمایش درگاه موبایلی )
factorNumber String optional شماره فاکتور شما (اختیاری)
description String optional توضیحات (اختیاری، حداکثر 255 کاراکتر)

Example request:

curl --request POST \
--url https://vandar.io/api/ipg/2step/send \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--cookie __cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362 \
--form api_key=API_KEY \
--form amount=10000 \
--form callback_url=https://dash.paperpiano.ir/callback \
--form mobile_number= \
--form factorNumber= \
--form description=
var client = new RestClient("https://vandar.io/api/ipg/2step/send");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddCookie("__cfduid", "d59bce9bad3db5171daea67d5f088a1f01561364362");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://vandar.io/api/ipg/2step/send"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cookie", "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362")
req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.post("https://vandar.io/api/ipg/2step/send")
	.header("cookie", "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362")
	.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
	.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
	.asString();
var http = require("https");

var options = {
"method": "POST",
"hostname": "vandar.io",
"port": null,
"path": "/api/ipg/2step/send",
"headers": {
"cookie": "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
"content-type": "multipart/form-data; boundary=---011000010111000001101001",
"content-length": "0"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n");
req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://vandar.io/api/ipg/send/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n",
CURLOPT_COOKIE => "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
CURLOPT_HTTPHEADER => array(
"content-type: multipart/form-data; boundary=---011000010111000001101001"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPSConnection("vandar.io")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

headers = {
'cookie': "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
'content-type': "multipart/form-data; boundary=---011000010111000001101001"
}

conn.request("POST", "/api/ipg/2step/send", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://vandar.io/api/ipg/2step/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["cookie"] = '__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\nAPI_KEY\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n10000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\nhttps://dash.paperpiano.ir/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile_number\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"factorNumber\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "token": "Payment Token"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن callback_url الزامی است",
    "callback_url معتبر نیست",
    "وارد کردن amount الزامی است",
    "amount نباید کوچکتر از 1000 باشد",
    "amount باید عدد یا رشته‌ای از اعداد باشد"
  ]
}


انتقال

در صورتی که در مرحله ارسال دیتا، اطلاعات ارسالی صحیح باشد و دو مقدار status و token را دریافت کرده باشید باید کاربر را به شیوه روبرو به درگاه ریدایرکت کنید. ابتدا باید عددی که در مرحله اول در متغییر {token} دریافت کردید را در انتهای آدرس قرار بدهید و کاربر را به URL ایجاد شده ریدایرکت کنید تا بلافاصله کاربر به درگاه پرداخت هدایت شود و سپس مرحله سوم را انجام بدهید.


Example request:

$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$amount = 1000;
$redirect = 'https://yourdomain.ir/verify.php';
$mobile = '09123456789';
$factorNumber = '00120';
$description = 'Lorem ipsom .....'
$result = send($api, $amount, $redirect, $mobile,
$factorNumber, $description);
$result = json_decode($result);

if ($result->status == 1) {
	$go = "https://vandar.io/ipg/2step/$result->token";
	header("Location: $go");
} else {
	echo $result->status;
}


بازگشت

مرحله سوم زمانی انجام میشود که کاربر از درگاه پرداخت بر میگردد. در این مرحله با توجه به نتیجه تراکنش و وضعیت آن، ما کاربر را به آدرس کالبک شما که در مرحله اول با پارامتر redirect ارسال کرده بودید هدایت میکنیم. توکنی که در مرحله اول صادر شده به صورت GET در آدرس بازگشتی و داده های تراکنش به صورت POST قابل دریافت است. نکته : برای دریافت اطلاعات تراکنش توصیه می شود از api دریافت اطلاعات تراکنش استفاده کنید.

Example request:

$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$confirm = true;
$result = json_decode(confirm($api,$token,$confirm));
if(isset($result->status)){
	if($result->status == 1){
		$verifyResult = json_decode(confirm($api,$token));
		if(isset($verifyResult->status)){
			if($verifyResult->status == 1){
				echo "SUCCESS";
			} else {
				echo "FAILED";
			}
		} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}

Example response (200):

{
  "status": 1,
  "amount": "10000",
  "transId": 155058785697,
  "refnumber": "GmshtyjwKSuZXT81+6o9nKIkOcW*****PY05opjBoF",
  "trackingCode": "23***6",
  "factorNumber": null,
  "mobile": null,
  "description": "description",
  "cardNumber": "603799******6299",
  "CID": "ECC1F6931DDC1B8A0892293774836F3FFAC4A3C9D34997405F340FCC1BDDED82",
  "paymentDate": "2019-02-19 18:21:50",
  "message": "Confirm requierd"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن token الزامی است",
    "token معتبر نیست",
    "تراکنش با خطا مواجه شده است"
  ]
}


اطلاعات تراکنش

برای دریافت اطلاعات تراکنش از طریق API نکته: این روش برای دریافت اطلاعات تراکنش بسیار روش امن تری است.

Example request:

$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  
$api = 'fb1a319b28697e008d1l2d9adabcab4187474f73';
$token = $_GET['token'];
$result = json_decode(confirm($api,$token,$confirm));
	if(isset($result->status)){
		if($result->status == 1){
			$verifyResult = json_decode(confirm($api,$token));
			if(isset($verifyResult->status)){
				if($verifyResult->status == 1){
					echo "Transaction Detail";
				} else {
					echo "FAILED";
				}
			} else {
			if($_GET['status'] == 0){
				echo "FAILED";
			}
		}
	} else {
		echo "FAILED";
	}
} else {
	if($_GET['status'] == 0){
		echo "FAILED";
	}
}
  

Example response (200):

{
  "status": 1,
  "amount": "10000",
  "transId": 155058785697,
  "refnumber": "GmshtyjwKSuZXT81+6o9nKIkOcW*****PY05opjBoF",
  "trackingCode": "23***6",
  "factorNumber": null,
  "mobile": null,
  "description": "description",
  "cardNumber": "603799******6299",
  "CID": "ECC1F6931DDC1B8A0892293774836F3FFAC4A3C9D34997405F340FCC1BDDED82",
  "paymentDate": "2019-02-19 18:21:50",
  "message": "Confirm requierd"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن token الزامی است",
    "token معتبر نیست",
    "تراکنش با خطا مواجه شده است"
  ]
}


کانفرم

برای دریافت اطلاعات تراکنش از طریق API نکته: این روش برای دریافت اطلاعات تراکنش بسیار روش امن تری است.

Example request:

function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}
function confirm($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/confirm',
		[
			'api_key' => $api,
			'token' => $token,
			'confirm' => $confirm,
		]
	);
}

Example response (200):

{
  "status": 1,
  "message": "Transaction Confirmed"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن token الزامی است",
    "token معتبر نیست",
    "نتیجه تراکنش قبلا از طرف وندار اعلام گردیده",
    "تراکنش با خطا مواجه شده است"
  ]
}


تایید

مهم : درصورت موفقیت آمیز بودن تراکنش، با فراخوانی متد وریفای، هر بار پیام وریفای تراکنش اعلام می شود. برای پیشگیری از بروز تقلب پذیرنده باید قبل از ارائه محصول و خدمات با استفاده از شماره تراکنش شبکه پرداخت وندار ( همان transId ) از عدم وجود شماره تراکنش در بانک اطلاعاتی خود اطمینان حاصل کند سپس خدمات را به مشتری ارائه نماید.

Example request:

function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}
function verify($api, $token)
{
	return curl_post(
		'https://vandar.io/api/ipg/2step/verify',
		[
			'api_key' => $api,
			'token' => $token,
		]
	);
}

Example response (200):

{
  "status": 1,
  "amount": "10000",
  "transId": 155058785697,
  "factorNumber": null,
  "mobile": null,
  "description": "description",
  "cardNumber": "603799******6299",
  "paymentDate": "2019-02-19 18:21:50",
  "message": "ok"
}

Example response (400):

{
  "status": 0,
  "errors": [
    "وارد کردن api key الزامی است",
    "api_key معتبر نیست",
    "IP پذیرنده معتبر نیست",
    "وارد کردن token الزامی است",
    "token معتبر نیست",
    "نتیجه تراکنش قبلا از طرف وندار اعلام گردیده",
    "تراکنش با خطا مواجه شده است"
  ]
}


احراز هویت

دریافت توکن

برای فراخوانی دیگر متد های وندار نیاز است که ابتدا متد ورود رو فراخوانی کنید. با فراخوانی این سرویس اطلاعات کاربری و توکن مورد نیاز برای استفاده در هدر دیگر سرویس ها، بازگردانده می شود.

پارامترهای ورودی

Parameter Type Status Description
mobile string required شماره موبایل ثبت شده در وندار
password string required رمز عبور حساب کاربری وندار

Example request:

curl -X POST "BASIC_URL /v2/login" \
    -H "Content-Type: application/json" \
    -d '{"mobile":"non","password":"accusantium"}'
var client = new RestClient("BASIC_URL /v2/login");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09353917307\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nMahdi!@09353917307\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.vandar.io/v2/login"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09123456789\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\npassword\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("cookie", "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
HttpResponse response = Unirest.post("https://api.vandar.io/v2/login")
  .header("cookie", "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362")
  .header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09123456789\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\npassword\r\n-----011000010111000001101001--\r\n")
  .asString();
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.vandar.io",
  "port": null,
  "path": "/v2/login",
  "headers": {
    "cookie": "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001",
    "content-length": "0"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09123456789\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\npassword\r\n-----011000010111000001101001--\r\n");
req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.vandar.io/v2/login",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09123456789\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\npassword\r\n-----011000010111000001101001--\r\n",
  CURLOPT_COOKIE => "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
  CURLOPT_HTTPHEADER => array(
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import http.client

conn = http.client.HTTPSConnection("api.vandar.io")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09123456789\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\npassword\r\n-----011000010111000001101001--\r\n"

headers = {
    'cookie': "__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("POST", "/v2/login", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.vandar.io/v2/login")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["cookie"] = '__cfduid=d59bce9bad3db5171daea67d5f088a1f01561364362'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"mobile\"\r\n\r\n09123456789\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\npassword\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body

Example response (200):

{
    "status": 1,
    "data": {
        "token": "token",
        "user": {
            "name": "امین امینی",
            "fname": "امین",
            "lname": "امینی",
            "email": "amin@gmail.com",
            "national_code": "29******16",
            "mobile": "090*****84",
            "avatar": "users\/avatars\/SxWicKdwtV8C********SgyhH2CoU.jpeg",
            "address": null,
            "postal_code": "76******34",
            "phone_number": null,
            "wallet": 1200,
            "deductible_amount": "0",
            "birthdate": "1366\/5\/6",
            "birthdate_year": 1366,
            "birthdate_month": 5,
            "birthdate_day": 6,
            "telegram_chat_id": 25490205,
            "meta": {
                "onboarding": true,
                "notification": {
                    "transaction": {
                        "sms": true,
                        "email": true,
                        "telegram": false,
                        "notif": true
                    },
                    "settlement": {
                        "sms": true,
                        "email": true,
                        "telegram": false,
                        "notif": true
                    },
                    "ticket": {
                        "sms": true,
                        "email": true,
                        "telegram": false,
                        "notif": true
                    },
                    "auth": {
                        "sms": true,
                        "email": true,
                        "telegram": false,
                        "notif": true
                    }
                }
            },
            "statusBox": {
                "mobile": "accepted",
                "email": "accepted",
                "personal_information": "accepted"
            },
            "invitation": null,
            "status": 0,
            "created_at": {
                "date": "2019-02-16 11:05:59.000000",
                "timezone_type": 3,
                "timezone": "Asia\/Tehran"
            },
            "updated_at": {
                "date": "2019-09-15 12:46:49.000000",
                "timezone_type": 3,
                "timezone": "Asia\/Tehran"
            }
        }
    }
}

کسب و کارها

لیست

با استفاده از این متد می‌توانید اطلاعات یک کسب و کار و لیستی از کسب و کار را مشاهده کنید و همچنین لیست کاربران کسب و کار را مشاهده کنید.

Example request:

curl --request GET \
--url BASIC_URL /v2/business \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("BASIC_URL /v2/business");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "BASIC_URL /v2/business"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("BASIC_URL /v2/business")
    .header("authorization", "Bearer [TOKEN]")
    .asString();
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});

xhr.open("GET", "BASIC_URL /v2/business");
xhr.setRequestHeader("authorization", "Bearer [TOKEN]");

xhr.send(data);
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "BASIC_URL /v2/business",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer [TOKEN]"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPConnection("api.vandar.prg")

payload = ""

headers = { 'authorization': "Bearer [TOKEN]" }

conn.request("GET", "/v2/business", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("BASIC_URL /v2/business")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "token": "token",
    "user": {
      "name": "امین امینی",
      "fname": "امین",
      "lname": "امینی",
      "email": "amin@gmail.com",
      "national_code": "29******16",
      "mobile": "090*****84",
      "avatar": "users\/avatars\/SxWicKdwtV8C********SgyhH2CoU.jpeg",
      "address": null,
      "postal_code": "76******34",
      "phone_number": null,
      "wallet": 1200,
      "deductible_amount": "0",
      "birthdate": "1366\/5\/6",
      "birthdate_year": 1366,
      "birthdate_month": 5,
      "birthdate_day": 6,
      "telegram_chat_id": 25490205,
      "meta": {
        "onboarding": true,
        "notification": {
          "transaction": {
            "sms": true,
            "email": true,
            "telegram": false,
            "notif": true
          },
          "settlement": {
            "sms": true,
            "email": true,
            "telegram": false,
            "notif": true
          },
          "ticket": {
            "sms": true,
            "email": true,
            "telegram": false,
            "notif": true
          },
          "auth": {
            "sms": true,
            "email": true,
            "telegram": false,
            "notif": true
          }
        }
      },
      "statusBox": {
        "mobile": "accepted",
        "email": "accepted",
        "personal_information": "accepted"
      },
      "invitation": null,
      "status": 0,
      "created_at": {
        "date": "2019-02-16 11:05:59.000000",
        "timezone_type": 3,
        "timezone": "Asia\/Tehran"
      },
      "updated_at": {
        "date": "2019-09-15 12:46:49.000000",
        "timezone_type": 3,
        "timezone": "Asia\/Tehran"
      }
    }
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


اطلاعات

با استفاده از این متد می‌توانید اطلاعات یک کسب و کار و لیستی از کسب و کار را مشاهده کنید و همچنین لیست کاربران کسب و کار را مشاهده کنید.

Example request:

curl --request GET \
--url BASIC_URL /v2/business/{business} \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("BASIC_URL /v2/business/{business}");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "BASIC_URL /v2/business/{business}/iam"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("BASIC_URL /v2/business/{business}/iam")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("http");

var options = {
"method": "GET",
"hostname": "api.vandar.prg",
"port": null,
"path": "/v2/business/{business}/iam",
"headers": {
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "BASIC_URL /v2/business/{business}/iam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer [TOKEN]"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPConnection("api.vandar.prg")

payload = ""

headers = { 'authorization': "Bearer [TOKEN]" }

conn.request("GET", "/v2/business/{business}/iam", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("BASIC_URL /v2/business/{business}/iam")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "id": 1,
    "active": 1,
    "business_name": "test1",
    "business_name_fa": "تست ۱",
    "legal_business_name": null,
    "national_id": "14******36",
    "business_type": "legal",
    "phone_number": "02******87",
    "postal_code": "15******17",
    "city_id": null,
    "mcc_code": null,
    "address": "خیابان بهار شمالی، پلاک ۱۲ طبقه دوم واحد ۴",
    "wallet": 690000,
    "avatar": "businesses\/avatars\/UnPUhnvEqz**********P8luZeRflNZul.jpeg",
    "statusBox": {
      "payment_required": false,
      "national_card_photo": "add",
      "official_Newspaper": "add",
      "introduction_letter": "add"
    },
    "status": 1,
    "today_transactions": 0,
    "today_settlements": 0,
    "role_name": "برنامه نویس",
    "role": "developer",
    "permissions": [
      "view_gateway_ipgs",
      "create_gateway_ipgs",
      "edit_gateway_ipgs"
    ]
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


کاربران

Example request:

curl --request GET \
--url BASIC_URL /v2/business/{business}/iam \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
var client = new RestClient("BASIC_URL /v2/business/{business}/iam");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);

Example response (200):

{
  "status": 1,
  "data": {
    "users": [
      {
        "name": "امین امینی",
        "avatar": "https:\/\/vandar.io\/storage\/users\/avatars\/SxWicKdwtV8*****sZSgyhH2CoU.jpeg",
        "role": "مالک کسب و کار",
        "status": 1,
        "role_id": 0,
        "id": null
      }
    ]
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}

شماره شبا

لیست

Example request:

curl --request GET \
--url https://basic_url/v2/business/{business}/iban \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("https://basic_url/v2/business/{business}/iban");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/iban"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("accept", "application/json")
req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/iban")
	.header("accept", "application/json")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("https");

var options = {
"method": "GET",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/iban",
"headers": {
"accept": "application/json",
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://basic_url/v2/business/{business}/iban",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "GET",
     CURLOPT_POSTFIELDS => "",
     CURLOPT_HTTPHEADER => array(
          "accept: application/json",
          "authorization: Bearer [TOKEN]"
     ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = {
'accept': "application/json",
'authorization': "Bearer [TOKEN]"
}

conn.request("GET", "/v2/business/{business}/iban", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/iban")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "ibans": [
      {
        "id": 179,
        "IBAN": "IR150620000000*********001",
        "bank_name": "بانک آینده",
        "account_number": "*********001",
        "account_description": "حساب فعال است",
        "account_owner": [
          {
            "firstName": "احمد",
            "lastName": "احمدی"
          }
        ]
      },
      {
        "id": 191,
        "IBAN": "IR150620000000*********004",
        "bank_name": "بانک آینده",
        "account_number": "*********004",
        "account_description": "حساب فعال است",
        "account_owner": [
          {
            "firstName": "سیدمحمد",
            "lastName": "محمدی"
          }
        ]
      }
    ]
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


ذخیره

پارامترهای ورودی

Parameter Type Status Description
IBAN string required شماره شبا جدید

Example request:

curl --request POST \
--url https://basic_url/v2/business/{business}/iban/store \
--header 'authorization: Bearer [TOKEN]' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form IBAN=IR830570024880010574154102
var client = new RestClient("https://basic_url/v2/business/{business}/iban/store");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddHeader("authorization", "Bearer [TOKEN]");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/iban/store"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")
req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/iban")
	.header("accept", "application/json")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("https");

var options = {
"method": "POST",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/iban/store",
"headers": {
"content-type": "multipart/form-data; boundary=---011000010111000001101001",
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n");
req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://basic_url/v2/business/{business}ipg/show",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer [TOKEN]"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n"

headers = {
'content-type': "multipart/form-data; boundary=---011000010111000001101001",
'authorization': "Bearer [TOKEN]"
}

conn.request("POST", "/v2/business/{business}/iban/store", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/iban/store")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request["authorization"] = 'Bearer [TOKEN]'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "iban": [
      {
        "id": 191,
        "IBAN": "IR150620000000*********004",
        "bank_name": "بانک آینده",
        "account_number": "*********004",
        "account_description": "حساب فعال است",
        "account_owner": [
          {
            "firstName": "سیدمحمد",
            "lastName": "محمدی"
          }
        ]
      }
    ]
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


حذف

Example request:

curl --request DELETE \
--url https://basic_url/v2/business/{business}/iban/{uuid} \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001'
var client = new RestClient("https://basic_url/v2/business/{business}/iban/store");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddHeader("authorization", "Bearer [TOKEN]");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/iban/store"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"IBAN\"\r\n\r\nIR830570024880010574154102\r\n-----011000010111000001101001--\r\n")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")
req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/iban")
	.header("accept", "application/json")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
curl --request POST \
--url https://basic_url/v2/business/{business}/iban/store \
--header 'authorization: Bearer [TOKEN]' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--forvar http = require("https");

var options = {
"method": "DELETE",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/iban/{uuid}",
"headers": {
"accept": "application/json",
"content-length": "0",
"authorization": "Bearer [TOKEN]",
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();m IBAN=IR830570024880010574154102
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://basic_url/v2/business/{business}/iban/{uuid}",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "DELETE",
     CURLOPT_POSTFIELDS => "",
     CURLOPT_HTTPHEADER => array(
          "accept: application/json",
          "authorization: Bearer [TOKEN]",
          "content-type: multipart/form-data; boundary=---011000010111000001101001"
     ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = {
'accept': "application/json",
'authorization': "Bearer [TOKEN]",
'content-type': "multipart/form-data; boundary=---011000010111000001101001"
}

conn.request("DELETE", "/v2/business/{business}/iban/{uuid}", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/iban/{uuid}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer [TOKEN]'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "message": "شماره شبا با موفقیت حذف شد."
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


صورت‌حساب

موجودی

Example request:

curl --request GET \
--url https://basic_url/v2/business/{business}/transaction \
--header 'authorization: Bearer [TOKEN]'
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/balance"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
curl --request GET \
--url https://basic_url/v2/business/{business}ipg/show \
--header 'authorization: Bearer [TOKEN]'
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/balance")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("https");

var options = {
"method": "GET",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/balance",
"headers": {
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://basic_url/v2/business/{business}/balance",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "GET",
     CURLOPT_POSTFIELDS => "",
     CURLOPT_HTTPHEADER => array(
          "authorization: Bearer [TOKEN]"
     ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = { 'authorization': "Bearer [TOKEN]" }

conn.request("GET", "/v2/business/{business}/balance", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "wallet": 2994800,
    "currency": "Toman"
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


گزارش صورت‌حساب

پارامترهای ورودی

Parameter Status Description
fromDate optional شروع بازه زمانی
toDate optional پایان بازه زمانی
statusKind optional transactions or settlement
status optional succeed, failed, pending or canceled.
channel optional ipg, form.
ref_id optional search by ref id.
tracking_code optional search by tracking code.
per_page optional تعداد بازگشتی تراکنش ها در هر صفحه
fromDate optional

Example request:

curl --request GET \
--url https://basic_url/v2/business/{business}/balance \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("https://basic_url/v2/business/{business}/transaction");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/transaction"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/transaction")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("https");

var options = {
"method": "GET",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/transaction",
"headers": {
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://basic_url/v2/business/{business}/transaction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer [TOKEN]"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/transaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body
curl --request GET \ {
    "status": 1,
    "amount": "10000",
    "transId": 155058785697,
    "refnumber": GmshtyjwKSuZXT81+6o9nKIkOcW*****PY05opjBoF,
    "trackingCode": 23***6,
    "factorNumber": null,
    "mobile": null,
    "description": "description",
    "cardNumber": "603799******6299",
    "CID": "ECC1F6931DDC1B8A0892293774836F3FFAC4A3C9D34997405F340FCC1BDDED82",
    "paymentDate": "2019-02-19 18:21:50",
    "message": "Confirm requierd"
  }

--url https://basic_url/v2/business/{business}/balance \
--header 'authorization: Bearer [TOKEN]'

Example response (200):

{
  "status": 1,
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 156265807468,
        "amount": 50000000,
        "wage": 0,
        "status": -4,
        "ref_id": null,
        "tracking_code": null,
        "card_number": null,
        "cid": null,
        "verified": 0,
        "channel": "تسویه حساب",
        "payment_date": null,
        "created_at": "22:29 - 1398\/6\/26",
        "wallet": 22994800,
        "result": null,
        "description": "تسویه حساب وندار",
        "factorNumber": null,
        "mobile": null,
        "callback_url": null,
        "form_title": null,
        "payer": {
          "ip": null,
          "name": null,
          "email": null,
          "phone": null,
          "address": null,
          "mobile": null,
          "description": "تسویه حساب وندار"
        },
        "receiver": {
          "name": "امین امینی",
          "IBAN": "IR150620000000*********004",
          "bank_name": "بانک آینده"
        }
      }
    ],
    "first_page_url": "https:\/\/api.vandar.io\/v2\/business\/hosting\/transaction?page=1",
    "from": 1,
    "last_page": 8,
    "last_page_url": "https:\/\/api.vandar.io\/v2\/business\/hosting\/transaction?page=8",
    "next_page_url": "https:\/\/api.vandar.io\/v2\/business\/hosting\/transaction?page=2",
    "path": "https:\/\/api.vandar.io\/v2\/business\/hosting\/transaction",
    "per_page": 10,
    "prev_page_url": null,
    "to": 10,
    "total": 79
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


تسویه

لیست

Example request:

curl --request GET \
--url https://basic_url/v2/business/{business}/settlement \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("https://basic_url/v2/business/{business}/settlement");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/settlement"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/settlement")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("https");

var options = {
"method": "GET",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/settlement",
"headers": {
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://basic_url/v2/business/{business}/settlement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer [TOKEN]"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = { 'authorization': "Bearer [TOKEN]" }

conn.request("GET", "/v2/business/{business}/settlement", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/settlement")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "wallet": 2994800,
    "deductible_amount": 0,
    "currency": "Toman",
    "settlements": {
      "current_page": 1,
      "data": [
        {
          "id": 615,
          "transaction_id": 156265807475,
          "amount": 20000000,
          "payment_number": "1234596",
          "status": "PENDING",
          "wallet": "29948000",
          "settlement_date": "2019-09-19",
          "message": null,
          "iban_id": 79
        },
        {
          "id": 614,
          "transaction_id": 156265807474,
          "amount": 50000000,
          "payment_number": "1234596",
          "status": "PENDING",
          "wallet": "229948000",
          "settlement_date": "2019-09-19",
          "message": null,
          "iban_id": 79
        }
      ],
      "first_page_url": "https:\/\/api.vandar.io\/v2\/business\/hosting\/settlement?page=1",
      "from": 1,
      "last_page": 1,
      "last_page_url": "https:\/\/api.vandar.io\/v2\/business\/hosting\/settlement?page=1",
      "next_page_url": null,
      "path": "https:\/\/api.vandar.io\/v2\/business\/hosting\/settlement",
      "per_page": 20,
      "prev_page_url": null,
      "to": 11,
      "total": 11
    }
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


ذخیره

پارامترهای ورودی

Parameter Type Status Description
amount integer required مبلع (تومان)
iban_id integer required شناسه شماره شبا
payment_number integer optional custom payment number.

Example request:

curl --request POST \
--url https://basic_url/v2/business/{business}/settlement/store \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form amount=5100000 \
--form iban_id=bb6b1380-23c4-11ea-a37f-a58be408982b \
--form payment_number=1234596
var client = new RestClient("https://basic_url/v2/business/{business}/settlement/store");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer [TOKEN]");
request.AddHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/settlement/store"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("accept", "application/json")
req.Header.Add("authorization", "Bearer [TOKEN]")
req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.post("https://basic_url/v2/business/{business}/settlement/store")
	.header("accept", "application/json")
	.header("authorization", "Bearer [TOKEN]")
	.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
	.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n")
	.asString();
var http = require("https");

var options = {
"method": "POST",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/settlement/store",
"headers": {
"accept": "application/json",
"content-length": "0",
"authorization": "Bearer [TOKEN]",
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n");
req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://basic_url/v2/business/{business}/settlement/store",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Bearer [TOKEN]",
"content-type: multipart/form-data; boundary=---011000010111000001101001"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n"

headers = {
'accept': "application/json",
'authorization': "Bearer [TOKEN]",
'content-type': "multipart/form-data; boundary=---011000010111000001101001"
}

conn.request("POST", "/v2/business/{business}/settlement/store", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/settlement/store")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer [TOKEN]'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"amount\"\r\n\r\n5100000\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"iban_id\"\r\n\r\nbb6b1380-23c4-11ea-a37f-a58be408982b\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payment_number\"\r\n\r\n1234596\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "settlement": {
      "616": {
        "id": 616,
        "transaction_id": 156981777915,
        "amount": 12000,
        "payment_number": "1234596",
        "status": "PENDING",
        "wallet": "29828000",
        "settlement_date": "2019-10-02",
        "message": null,
        "iban_id": 79
      }
    }
  }
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


نمایش

Example request:

curl --request GET \
--url https://basic_url/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476 \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("https://basic_url/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.get("https://basic_url/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
var http = require("https");

var options = {
"method": "GET",
"hostname": "basic_url",
"port": null,
"path": "/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476",
"headers": {
"content-length": "0",
"authorization": "Bearer [TOKEN]"
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://basic_url/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "GET",
     CURLOPT_POSTFIELDS => "",
     CURLOPT_HTTPHEADER => array(
          "authorization: Bearer [TOKEN]"
     ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = { 'authorization': "Bearer [TOKEN]" }

conn.request("GET", "/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/settlement/dbe9aae0-2423-11ea-9244-5f5fa0d00476")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "data": {
    "settlement": {
      "id": 616,
      "transaction_id": 156981777915,
      "amount": 12000,
      "payment_number": "1234596",
      "status": "PENDING",
      "wallet": "29828000",
      "settlement_date": "2019-10-02",
      "message": null,
      "iban_id": 79
    }
  }:-/:
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


حذف

Example request:

curl --request DELETE \
--url https://basic_url/v2/business/{business}/settlement/157893257835 \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]'
var client = new RestClient("https://basic_url/v2/business/{business}/settlement/157893257835");
var request = new RestRequest(Method.DELETE);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer [TOKEN]");
IRestResponse response = client.Execute(request);
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://basic_url/v2/business/{business}/settlement/157893257835"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("accept", "application/json")
req.Header.Add("authorization", "Bearer [TOKEN]")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
HttpResponse response = Unirest.delete("https://basic_url/v2/business/{business}/settlement/157893257835")
	.header("accept", "application/json")
	.header("authorization", "Bearer [TOKEN]")
	.asString();
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://basic_url/v2/business/{business}/settlement/157893257835",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authorization: Bearer [TOKEN]"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --request POST \
--url https://basic_url/v2/business/{business}/settlement/store \
--header 'accept: application/json' \
--header 'authorization: Bearer [TOKEN]' \
--header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
--form amount=5100000 \
--form iban_id=bb6b1380-23c4-11ea-a37f-a58be408982b \
--form payment_number=1234596
import http.client

conn = http.client.HTTPSConnection("basic_url")

payload = ""

headers = {
'accept': "application/json",
'authorization': "Bearer [TOKEN]"
}

conn.request("DELETE", "/v2/business/{business}/settlement/157893257835", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://basic_url/v2/business/{business}/settlement/157893257835")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer [TOKEN]'

response = http.request(request)
puts response.read_body

Example response (200):

{
  "status": 1,
  "message": "درخواست تسویه شما از دستور پرداخت خارج شد و وجه تسویه به حساب شما برگشت داده شد"
}

Example response (401):

{
  "status": 0,
  "error": "Unauthenticated"
}


خطاها

The Vandar API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request sucks
401 Unauthorized -- Your token is wrong
403 Forbidden -- The kitten requested is hidden for administrators only
404 Not Found -- The specified kitten could not be found
405 Method Not Allowed -- You tried to access a kitten with an invalid method
406 Not Acceptable -- You requested a format that isn't json
410 Gone -- The kitten requested has been removed from our servers
418 I'm a teapot
422 Bad Request -- Your request sucks
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarially offline for maintanance. Please try again later.