Document


Getting Started

First, you will need api_key and secret_key. These API keys located in your account. You are required it when you want to use API key for interact with service.
Also you required to restrict API access to your own secure IP addresses. If you do not know your server's IPaddress, you can run this command on your server.

curl 'https://api.payland.top/api/'


API Key Setup

First, get API key and secret key from panel and choose method's that you need.
Never share your API key/secret key to ANYONE.
API key and secret key will be something like this:

API Key: 4f3c12fa0a1d1ac8b026298b980f16b2
SECRET KEY: f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6
For each request you must send two params in header, one of this is api_key and another is api_sign you must create api_sign by hmac_hash sha256 on params that you will be sent!
for example: you want to send par1=value1 and par2=value2 to API
at the first you must create api_sign string by secret_key .

PHP:

$post_encode = http_build_query([
             'par1'=>'value1',
             'par2'=>'value2'
        ]);
$s = hash_hmac('sha256', $post_encode, 'f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6', true);
echo base64_encode($s); //g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=
    


Node.js:
var crypto = require('crypto');
var hash = crypto.createHmac('SHA256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").update("par1=value1&par2=value2").digest('base64');
    



Python:
import hashlib
import hmac
import base64

dataToBeSigned= bytes("par1=value1&par2=value2").encode('utf-8')
portalKey = bytes("f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").encode('utf-8')

signature = base64.b64encode(hmac.new(portalKey, dataToBeSigned, digestmod=hashlib.sha256).digest())
    


Ruby:
require 'openssl'
require "base64"

hash  = OpenSSL::HMAC.digest('sha256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6", "par1=value1&par2=value2")
token = Base64.encode64(hash)
token.delete("\n")
    


Java:
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;

public class ApiSecurityExample {
  public static void main(String[] args) {
    String portalKey = "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6";
    String dataToBeSigned= "par1=value1&par2=value2";

    Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
    SecretKeySpec secret_key = new SecretKeySpec(portalKey.getBytes(), "HmacSHA256");
    sha256_HMAC.init(secret_key);

    String hash = Base64.encodeBase64String(sha256_HMAC.doFinal(dataToBeSigned.getBytes()));
  }
}
    


Send request

At this level , you must have api_key and api_sign and params that you want to send par1=value1&par2=value2
send params via post method to API and set api_key and api_sign in header .

CURL

curl -H "api_key:4f3c12fa0a1d1ac8b026298b980f16b2" -H "api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=" --data "par1=value1&par2=value2" https://api.payland.top/api/        example

PHP
$_headers = [
	'api_key:4f3c12fa0a1d1ac8b026298b980f16b2',
	'api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $_headers);
curl_setopt($ch, CURLOPT_URL, 'https://api.payland.top/api/example');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'par1=value1&par2=value2');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
        


Response

All response is json format .

Success Sample:

{
	...
	"success": true,
	"status": 200
}
    
success will be true if everything is fine and status is same as a http status code.

Failed Sample:
{
	"errors": {
		"auth": "INVALID_API_SIGN"
	},
	"success": false,
	"status": 403
}
    


Hello

POST https://api.payland.top/api/hello

Name Type Mandatory Description
name string yes Kevin


Response:
{
	"trackid": "66C8EB-449618-643332-DC8FF7",
	"result": "Hello Kevin",
	"success": true,
	"status": 200
}
    


Random

POST https://api.payland.top/api/random

Name Type Mandatory Description
min integer yes set min of range
max integer yes set max of range


Response:
{
	"trackid": "08B171-F259CB-3E300C-9ABE83",
	"result": 15,
	"success": true,
	"status": 200
}
    


Balance of your account

POST https://api.payland.top/api/balance



Response:

{
	"trackid": "CEFAFF-B24445-04F5E7-73A37A",
	"result": {
		"amount": "9043400",
		"currency": "IRR"
	},
	"success": true,
	"status": 200
}
    

Shahkar

POST https://api.payland.top/api/shahkar

Name Type Mandatory Description
mobile string yes Example 09187776655
national_code string yes Example 3721234566


Response:
{
	"trackid": "CB74FC-E8BC91-590B9A-8503FA",
	"result": {
		"status": "MATCH"
	},
	"success": true,
	"status": 200
}
    

Identification

POST https://api.payland.top/api/identification

Name Type Mandatory Description
national_code string yes Example 3721234566
birthday string yes Example 1369-10-05


Response: (Success)
{
	"trackid": "5A5A47-5DA3A7-F4A5A6-A1145B",
	"result": {
		"nin": "3721234566",
		"name": "علی",
		"death": false,
		"family": "شمس",
		"gender": 1,
		"cardList": [],
		"birthDate": 13691005,
		"fatherName": "نعمت",
		"officeCode": 0,
		"officeName": "تهران",
		"shenasnameNo": 0,
		"shenasnameSeri": "د33",
		"shenasnameSerial": 32659
	},
	"success": true,
	"status": 200
}
    
Response: (Success but user not found! DO NOT RETRY! )
{
    "trackid": "5A5A47-5DA3A7-F4A5A6-A1145B",
    "result": {
        "error_code": 40417,
        "error_message": "کاربر یافت نشد"
    },
    "success": true,
    "status": 200
}

    
Response: (Fail! Retry after 30 minutes or more)
{
    "trackid": "04718E-7412B1-4638D0-5ACBEC",
    "errors": {
        "service": "Service is busy for this user , try again later"
    },
    "success": false,
    "status": 403
}
    
Response: (Fail! Retry after 30 minutes or more)
{
    "trackid": "04718E-7412B1-4638D0-5ACBEC",
    "errors": {
        "service": "Service unavailable!"
    },
    "success": false,
    "status": 403
}
    

Similarity

POST https://api.payland.top/api/similarity

Name Type Mandatory Description
national_code string yes Example 3721234566
birthDate string yes Example 1369-10-05
firstName string yes Example کریم
lastName string yes Example جعفری


Response:
{
	"trackid": "0F5B54-54F494-4F1625-36B1B2",
	"result": {
		"lastNameSimilarityPercentage": 90,
		"firstNameSimilarityPercentage": 100
	},
	"success": true,
	"status": 200
}
    

Iban

POST https://api.payland.top/api/iban

Name Type Mandatory Description
iban string yes Example IR520120000000001236547898


Response:
{
	"trackid": "866146-3FD570-D6CEB3-BAE220",
	"result":{
        "owner": "کریم زندی"
        },
	"success": true,
	"status": 200
}
    

Card

POST https://api.payland.top/api/card

Name Type Mandatory Description
card string yes Example 6104334455669998


Response:
{
	"trackid": "966146-3FD570-D6CEB3-BAE220",
	"result": {
        "owner":"مهناز زندی"
        },
	"success": true,
	"status": 200
}
    
Response: (when card is off!)
{
    "trackid": "89A6EC-DF6BE0-8A9AE5-73FBCE",
    "result": {
        "error_code": 40,
        "error_message": "کارت غیر فعال است"
    },
    "success": true,
    "status": 200
}

    

Card to iban

POST https://api.payland.top/api/Cardtoiban

Name Type Mandatory Description
card string yes Example 6104334455669998


Response:
{
	"trackid": "966146-3FD570-D6CEB3-BAE222",
	"result":{
        "type": "DEBIT",
        "number": "6104334455669998",
        "ibanInfo": {
            "bank": "MELLAT",
            "iban": "IR520120000000001122169988",
            "owners": [{
                    "lastName": "جعفری",
                    "firstName": "کریم"
                }
            ],
            "status": "ACTIVE",
            "depositNumber": "1122169988"
        }
    },
	"success": true,
	"status": 200
}
    

Address Info By Postal Code

POST https://api.payland.top/api/addressinfobypostalcode

Name Type Mandatory Description
code string yes Example 66881133


Response:
{
	"trackid": "966146-3FD570-D6CEB3-BAE229",
	"result": {
        "code": "66881133",
        "addressInfo": {
            "address": "استان تهران ، شهرستان تهران ، منطقه 22 ، جاویدی ، کوچه نسیم دوم ، پلاک 28 ، واحد سوم",
            "postalCode": "66881133"
        }
    },
	"success": true,
	"status": 200
}
    

Matching Card Number with national code

POST https://api.payland.top/api/matchingcardnumber

Name Type Mandatory Description
national_code string yes Example 3721234566
birthDate string yes Example 1369-10-05
card string yes Example 6104337812123232


Response:
{
	"trackid": "5A5A47-5DA3A7-F4A5A6-A1115B",
	"result": {
		"matched":1
	},
	"success": true,
	"status": 200
}