ZarinPal Rest API
API Endpoint
https://api.zarinpal.com/rest/v3The ZarinPal API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients.
Apps ¶
list fees ¶
List fees
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"id": "default",
"title": "کاربران قدیمی زرین پال",
"description": "کاربران قدیمی زرین پال",
"withdraw_method": [
{
"slug": "default",
"percent": 1,
"rebate": 0,
"reconcile_in": 28800
},
{
"slug": "zarincard",
"percent": 0.5,
"rebate": 0,
"reconcile_in": 43200
}
]
}
]
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"withdraw_method": {
"type": "object",
"properties": {
"slug": {
"type": "string"
},
"percent": {
"type": "integer"
},
"rebate": {
"type": "integer"
},
"reconcile_in": {
"type": "integer"
}
}
}
}
}
}
List FeesGET/fees.json
Cards ¶
list cards ¶
Show all user’s card
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardNotFound",
"error_message": "The selected card not found or you are not allowed to use it."
}
}
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": "5767cba0211677b008",
"account_id": 2455866200123,
"iban": "IR140620000002101234567898",
"pan": "636214******5863",
"is_legal": false,
"status": "Active",
"issuer": {
"name": "زرين کارت",
"slug": "ZarinCard"
},
"expired_at": "2019-06-30 19:30:11"
}
]
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"entity_id": {
"type": "string"
},
"account_id": {
"type": "integer",
"description": "account number"
},
"iban": {
"type": "string"
},
"pan": {
"type": "string"
},
"is_legal": {
"type": "boolean",
"description": "if is_legal set to ture this card is legal else it's real"
},
"issuer": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"slug": {
"type": "string"
}
}
},
"expired_at": {
"type": "string",
"description": "expiration date for this card"
}
}
}
}
List CardsGET/card.json
show card ¶
Show one user’s card
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardNotFound",
"error_message": "The selected card not found or you are not allowed to use it."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"entity_id": "5767cba02128e8bf1677b008",
"account_id": 2100455866200,
"iban": "IR140620000002100455866200",
"pan": "636214******5863",
"is_legal": false,
"status": "Active",
"issuer": {
"name": "زرين کارت",
"slug": "ZarinCard"
},
"expired_at": "2019-06-30 19:30:00"
},
"meta": {
"code": 200
}
}
Schema
{
"type": "object",
"properties": {
"entity_id": {
"type": "string"
},
"account_id": {
"type": "integer",
"description": "account number"
},
"iban": {
"type": "string"
},
"pan": {
"type": "string"
},
"is_legal": {
"type": "boolean",
"description": "if is_legal set to ture this card is legal else it's real"
},
"status": {
"type": "string"
},
"issuer": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"slug": {
"type": "string"
}
}
},
"expired_at": {
"type": "string",
"description": "expiration date for this card"
}
}
}
Show CardGET/card/[card_entity_id].json
new card ¶
create user’s card
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"iban": "IR150570028080012345531301",
"pan": "5022291012345190",
"isLegal": 1,
"expired_at": "1399-5"
}
Schema
{
"type": "object",
"properties": {
"iban": {
"type": "string"
},
"pan": {
"type": "string"
},
"is_legal": {
"type": "integer",
"description": "if is_legal set to 1 this card is legal and if is_legal set to 0 it's real"
},
"expired_at": {
"type": "string",
"description": "expiration date for this card"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardExists",
"error_message": "The card already exists."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardNotSupported",
"error_message": "The card issuer is not supported."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardExpired",
"error_message": "The card is expired."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Add card successfully."
}
}
New CardPOST/card.json
edit card ¶
edit user’s card
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"pan": "6362142100133635",
"expired_at": "1395-5"
}
Schema
{
"type": "object",
"properties": {
"pan": {
"type": "string"
},
"expired_at": {
"type": "string",
"description": "expiration date for this card"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardCanNotEdit",
"error_message": "You can not edit this card."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardExists",
"error_message": "The card already exists."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardNotSupported",
"error_message": "The card issuer is not supported."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardExpired",
"error_message": "The card is expired."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "This card updated successfully."
}
}
Edit CardPUT/card/[card_entity_id].json
Coupons ¶
list Coupons ¶
Get list of current users Coupons
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": "57df865af29889001f6dce12",
"code": "12345",
"type": "webservice",
"min_amount": "100",
"discount": {
"max_amount": "1111",
"percent": "1"
},
"webservice_id": "57df865af29889001f6",
"easypay_id": null,
"limit": "2",
"expired_at": "2021-02-20 01:01:00",
"meta": {
"code": 200
}
}
]
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"entity_id" : {
"type" : "string"
},
"code" : {
"type" : "string",
"description" : "coupon's code",
},
"type" : {
"type" : "webservice",
"description" : "if set webservice, this is for webservices .if set easypaym this is for easypays and if set all this for webservices and easypays"
},
"min_amount" : {
"type" : "string",
"description" : "This is min discount"
},
"discount" : {
"type" : "object",
"properties" : {
"max_amount" : {
"type" : "string",
"description" : "This is max discount"
},
"percent" : {
"type" : "string",
"description" : "This is percent discount"
}
}
},
"webservice_id" : {
"type" : "string"
},
"easypay_id" : {
"type" : "string"
},
"limit" : {
"type" : "string",
"description" : "this is limit for coupon",
},
"expired_at" : {
"type" : "string",
"description" : "this is expiration date for coupon",
}
}
}
}
List CouponsGET/coupon.json
show Coupon ¶
Get show information for one Coupon
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CouponNotFound",
"error_message": "The selected coupon not found or you are not allowed to use it."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"entity_id": "57df865af29889001f6dce12",
"code": "12345",
"type": "webservice",
"min_amount": "100",
"discount": {
"max_amount": "1111",
"percent": "1"
},
"webservice_id": "57df865af29889001f6",
"easypay_id": null,
"limit": "2",
"expired_at": "2021-02-20 01:01:00"
},
"meta": {
"code": 200
}
}
Schema
{
"type" : "object",
"properties" : {
"entity_id" : {
"type" : "string"
},
"code" : {
"type" : "string",
"description" : "coupon's code",
},
"type" : {
"type" : "webservice",
"description" : "if set webservice, this is for webservices . if set easypaym this is for easypays and if set all this for webservices and easypays"
},
"min_amount" : {
"type" : "string",
"description" : "This is min discount"
},
"discount" : {
"type" : "object",
"properties" : {
"max_amount" : {
"type" : "string",
"description" : "This is max discount"
},
"percent" : {
"type" : "string",
"description" : "This is percent discount"
}
}
},
"webservice_id" : {
"type" : "string"
},
"easypay_id" : {
"type" : "string"
},
"limit" : {
"type" : "string",
"description" : "this is limit for coupon",
},
"expired_at" : {
"type" : "string",
"description" : "this is expiration date for coupon",
}
}
}
Show CouponGET/coupon/[coupon_entity_id].json
new coupon ¶
Request for new coupon
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"code": "22232",
"discount": {
"max_amount": "333"
},
"webservice_id": null,
"easypay_id": "all",
"expired_at": "2021-02-20 01:01:00",
"limit": "12",
"min_amount": "222222",
"type": "webservice"
}
Schema
{
"type" : "object",
"properties" : {
"code" : {
"type" : "string",
"description" : "coupon's code",
},
"discount" : {
"type" : "object",
"properties" : {
"max_amount" : {
"type" : "string",
"description" : "This is max discount"
},
"percent" : {
"type" : "string",
"description" : "This is percent discount"
}
}
},
"webservice_id" : {
"type" : "string"
},
"easypay_id" : {
"type" : "string"
},
"expired_at" : {
"type" : "string",
"description" : "this is expiration date for coupon",
},
"limit" : {
"type" : "string",
"description" : "this is limit for coupon",
},
"type" : {
"type" : "webservice",
"description" : "if set webservice, this is for webservices . if set easypaym this is for easypays and if set all this for webservices and easypays"
},
"min_amount" : {
"type" : "string",
"description" : "This is min discount"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CouponExistsCode",
"error_message": "The coupon already exists."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CouponExpired",
"error_message": "The Coupon is expired."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Create coupon successfully"
}
}
New CouponPOST/coupon.json
edit coupon ¶
Edit this coupon
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"code": "1111",
"discount": {
"max_amount": "333"
},
"expired_at": "2021-02-20 01:01:00",
"easypay_id": null,
"webservice_id": "16d80a22-0d36-11e6-b4f0-000c295eb8fc",
"limit": "11",
"min_amount": "12345",
"type": "webservice"
}
Schema
{
"type" : "object",
"properties" : {
"code" : {
"type" : "string",
"description" : "coupon's code",
},
"discount" : {
"type" : "object",
"properties" : {
"max_amount" : {
"type" : "string",
"description" : "This is max discount"
},
"percent" : {
"type" : "string",
"description" : "This is percent discount"
}
}
},
"expired_at" : {
"type" : "string",
"description" : "this is expiration date for coupon",
},
"webservice_id" : {
"type" : "string"
},
"easypay_id" : {
"type" : "string"
},
"limit" : {
"type" : "string",
"description" : "this is limit for coupon",
},
"min_amount" : {
"type" : "string",
"description" : "This is min discount"
},
"type" : {
"type" : "webservice",
"description" : "if set webservice, this is for webservices . if set easypaym this is for easypays and if set all this for webservices and easypays "
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CouponExistsCode",
"error_message": "The coupon already exists."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CouponNotFound",
"error_message": "The selected coupon not found or you are not allowed to use it."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CouponExpired",
"error_message": "The Coupon is expired."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Update coupon successfully"
}
}
Edit CouponPUT/coupon/[coupon_entity_id].json
Easypays ¶
list easypays ¶
Get list of current users Easypays
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": "57d3b79e3afe47003131fa01",
"title": "new easypay from api",
"description": "sdsdsdsssdsdsss",
"price": 4000,
"required_fields": {
"email": "required",
"name": "required",
"mobile": "required"
},
"show_receipt": false,
"successful_redirect_url": "http://www.test.com",
"failed_redirect_url": "http://www.test.com",
"limit": 1,
"purse": 1,
"webservice_id": null,
"purse_name": "اصلی زرين پال",
"public_id": 3520,
"status": true,
"updated_at": "2016-10-02 16:23:08",
"created_at": "2016-09-10 12:04:54"
},
]
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"entity_id": {
"type": "string",
},
"title": {
"type": "string",
"description": "easypay's title"
},
"description": {
"type": "string"
},
"price": {
"type": "integer",
},"entity_id": {
"type": "string",
},
"required_fields": {
"type": "object",
"properties" : {
"email": {
"type" : "string",
"description" : "check required this field"
},
"name": {
"type" : "string",
"description" : "check required this field"
},
"mobile": {
"type" : "string",
"description" : "check required this field"
},
}
},
"show_receipt" : {
"type": "boolean",
"description" : "if set true show receipt.else do not show receipt"
},
"successful_redirect_url" : {
"type": "string"
},
"failed_redirect_url" : {
"type": "string"
},
"limit" : {
"type": "integer",
"description" : "limit for this easypay."
},
"purse" : {
"type" : "integer"
},
"webservice_id": {
"type": "string"
},
"purse_name": {
"type": "string"
},
"public_id": {
"type": "integer"
},
"status": {
"type": "boolean",
"description" : "check active or not active for this easypay."
},
"updated_at": {
"type": "string"
},
"created_at": {
"type": "string"
}
}
}
}
List EasypaysGET/easypay.json
show easypay ¶
Show information easypay
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "EasypayNotFound",
"error_message": "Easypay Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"entity_id": "57d3b79e3afe47003131fa01",
"title": "new easypay from api",
"description": "sdsdsdsssdsdsss",
"price": 4000,
"required_fields": {
"email": "required",
"name": "required",
"mobile": "required"
},
"show_receipt": false,
"successful_redirect_url": "http://www.test.com",
"failed_redirect_url": "http://www.test.com",
"limit": 1,
"purse": 1,
"webservice_id": null,
"purse_name": "اصلی زرين پال",
"public_id": 3520,
"status": true,
"updated_at": "2016-10-02 16:23:08",
"created_at": "2016-09-10 12:04:54"
}
}
Schema
{
"type": "object",
"properties": {
"entity_id": {
"type": "string",
},
"title": {
"type": "string",
"description": "easypay's title"
},
"description": {
"type": "string"
},
"price": {
"type": "integer",
},"entity_id": {
"type": "string",
},
"required_fields": {
"type": "object",
"properties" : {
"email": {
"type" : "string",
"description" : "check required this field"
},
"name": {
"type" : "string",
"description" : "check required this field"
},
"mobile": {
"type" : "string",
"description" : "check required this field"
},
}
},
"show_receipt" : {
"type": "boolean",
"description" : "if set true show receipt.else do not show receipt"
},
"successful_redirect_url" : {
"type": "string"
},
"failed_redirect_url" : {
"type": "string"
},
"limit" : {
"type": "integer",
"description" : "limit for this easypay."
},
"purse" : {
"type" : "integer"
},
"webservice_id": {
"type": "string"
},
"purse_name": {
"type": "string"
},
"public_id": {
"type": "integer"
},
"status": {
"type": "boolean",
"description" : "check active or not active for this easypay."
},
"updated_at": {
"type": "string"
},
"created_at": {
"type": "string"
}
}
}
Show EasypayGET/easypay/[easypay_entity_id].json
new easypay ¶
New user’s easypay
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"title": "new easypay from api",
"price": "4000",
"purse": 2,
"required_fields": {
"email": "-1",
"name": "0",
"mobile": "1"
},
"type": 1,
"show_receipt": 0,
"successful_redirect_url": "http://www.test.com",
"failed_redirect_url": "http://www.test.com",
"limited": 0,
"limit": 1
}
Schema
{
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "easypay's title"
}
"price": {
"type": "integer",
},
"purse" : {
"type" : "integer"
},
"required_fields": {
"type": "object",
"properties" : {
"email": {
"type" : "string",
"description" : "check required this field"
},
"name": {
"type" : "string",
"description" : "check required this field"
},
"mobile": {
"type" : "string",
"description" : "check required this field"
},
}
},
"type" : {
"type" : "integer",
"description" : "if set 0 this is Simple Easypay and set 1 This is Advanced"
},
"show_receipt" : {
"type": "boolean",
"description" : "if set true show receipt.else do not show receipt"
},
"successful_redirect_url" : {
"type": "string"
},
"failed_redirect_url" : {
"type": "string"
},
"limit" : {
"type": "integer",
"description" : "limit for this easypay."
},
"limited" : {
"type" : "integer",
"description" : "if you want to set limit you must set this to 1"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Create Easypay successfully."
}
}
New EasypayPOST/easypay.json
edit easypay ¶
Edit user’s easypay
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"title": "new easypay from api",
"price": "4000",
"purse": 2,
"required_fields": {
"email": "-1",
"name": "0",
"mobile": "1"
},
"type": 1,
"show_receipt": 0,
"successful_redirect_url": "http://www.test.com",
"failed_redirect_url": "http://www.test.com",
"limited": 0,
"limit": 1
}
Schema
{
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "easypay's title"
},
"price": {
"type": "integer",
},
"purse" : {
"type" : "integer"
},
"required_fields": {
"type": "object",
"properties" : {
"email": {
"type" : "string",
"description" : "check required this field"
},
"name": {
"type" : "string",
"description" : "check required this field"
},
"mobile": {
"type" : "string",
"description" : "check required this field"
},
}
},
"type" : {
"type" : "integer",
"description" : "if set 0 this is Simple Easypay and set 1 This is Advanced"
},
"show_receipt" : {
"type": "boolean",
"description" : "if set true show receipt.else do not show receipt"
},
"successful_redirect_url" : {
"type": "string"
},
"failed_redirect_url" : {
"type": "string"
},
"limit" : {
"type": "integer",
"description" : "limit for this easypay."
},
"limited" : {
"type" : "integer",
"description" : "if you want to set limit you must set this to 1"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "EasypayNotFound",
"error_message": "Easypay Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "'PurseNotFound'",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Update Easypay successfully."
}
}
Edit EasypayPUT/easypay/[easypay_entity_id].json
delete easypay ¶
delete this easypay
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "EasypayNotFound",
"error_message": "Easypay Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "This Easypay delete successfully"
}
}
Delete EasypayDELETE/easypay/[easypay_entity_id].json
OAuth ¶
logout ¶
logout user in app
Headers
Content-Type: application/json
Authorization: [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "InvalidCredentials",
"error_message": "The user credentials were incorrect."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Session Expired Successfully."
}
}
logoutGET/oauth/logout.json
register ¶
register new user
Headers
Content-Type: application/json
Body
{
"first_name": "tehran",
"last_name": "12222222",
"mobile": "09351123334"
}
Schema
{
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"mobile": {
"type": "string"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "you are registered, now verify your email address."
}
}
Post RegisterPOST/oauth/registerUser.json
Purses ¶
new purse ¶
New one user’s purse
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"purse": "1",
"name": "test1"
}
Schema
{
"type": "object",
"properties": {
"purse": {
"type": "string",
"description": "selected purse for cost create new purse"
},
"name": {
"type": "string",
"description": "name for new purse"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseLimit",
"error_message": "You can not create more purses."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotEnoughCredit",
"error_message": "Purse does not have enough credit."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "purse added successfully"
}
}
New PursePOST/purse.json
list purses ¶
List purse current user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": [
{
"purse": 1,
"name": "اصلی زرين پال",
"balance": 846200,
"updated_at": "2016-05-23 09:58:18",
"meta": {
"code": 200
}
}
]
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"purse": {
"type": "integer",
"description": "purse's nember"
},
"name": {
"type": "string",
"description": "purse's name"
},
"balance": {
"type": "integer",
"description": "purse's balance"
},
"updated_at": {
"type": "string",
"description": "update date for this purse"
}
}
}
}
List PursesGET/purse.json
balance purse ¶
get user’s purse balance
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"balance": 846200,
"today_income": 0,
"today_outcome": 0
},
"meta": {
"code": 200,
},
}
Schema
{
"type" : "object",
"properties" : {
"balance" : {
"type" : "integer",
"description" : "purse's balance"
},
"today_income" : {
"type" : "integer",
"description" : "purse's income in today"
},
"today_outcome" : {
"type" : "integer",
"description" : "purse's outcome in today"
}
}
}
Balance PurseGET/purse/balance/[purse_number].json
show purse ¶
Show info purse current user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "UserNotFound",
"error_message": "User Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data" : {
"purse": 1,
"public_id": 0,
"name": "مصطفی امیری",
"email_hash": "asdfghjklzxcvbnmoiuytrewas",
"zp_id": "ZP.0.0"
},
"meta": {
"code": 200
},
}
Schema
{
"type" : "object",
"properties" : {
"purse" : {
"type" : "integer",
"description" : "purse's number"
},
"public_id" : {
"type" : "integer",
"description" : "user's public id"
},
"name" : {
"type" : "string",
"description" : "user's name"
},
"email_hash" : {
"type" : "string",
"description" : "user's email hash"
},
"zp_id" : {
"type" : "string",
"description" : "user's zp"
}
}
}
Show PurseGET/purse/[:zp.0.0] or [email] or [mobile].json
edit purse ¶
Edit name purse
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "purse's name"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Update name purse successfully."
}
}
Edit PursePUT/purse/[purse_number].json
add Found ¶
Add found to purse
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
'amount' : 1000,
'purse' => 2,
'card_id' => 'aaaaabbbbbbcccccfdddddd',
'redirect_url' => 'zarinpal.com/panel'
}
Schema
{
"type": "object",
"properties": {
"amount": {
"type": "integer"
},
"purse": {
"type": "string"
},
"card_id": {
"type": "string",
"description": "entity id card."
},
"redirect_url": {
"type": "string"
},
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "InvalidPurse",
"error_message": "The purse is invalid."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "InvalidCard",
"error_message": "The card is invalid."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "AmountTooSmall",
"error_message": "The minimum transfer amount is 100 tomans'"
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"data": {
"authority": 123
}
}
}
Add FoundPOST/purse.json
Reports ¶
show report for one purse ¶
show transactions’s purse
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"from_date": "2016-06-22",
"to_date": "2016-06-23",
"purse_number": "1"
}
Schema
{
"type": "object",
"properties": {
"from_date": {
"type": "string",
"description": "start date for reporting"
},
"to_date": {
"type": "string",
"description": "end date for reporting"
},
"purse_number": {
"type": "string",
"description": "number purse"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "NotFound",
"error_message": "purse not found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "InvalidParams",
"error_message": "The input parameters are not sufficient."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200
},
"data": [
{
"date": "2016-06-22",
"income_count": 1,
"income_amount": 200,
"outgo_count": 2,
"outgo_amount": 100
},
{
"date": "2016-06-23",
"income_count": 1,
"income_amount": 200,
"outgo_count": 2,
"outgo_amount": 100
},
]
}
Report PursePOST/report/purseTransactions.json
show report for one webservice ¶
show transactions’s webservice
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"from_date": "2016-06-22",
"to_date": "2016-06-23",
"webservice_id": "4a0b7ff2-67ac-11e6-b8c295eb8fc"
}
Schema
{
"type": "object",
"properties": {
"from_date": {
"type": "string",
"description": "start date for reporting"
},
"to_date": {
"type": "string",
"description": "end date for reporting"
},
"webservice_id": {
"type": "string",
"description": "entity id webservice"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "NotFound",
"error_message": "webservice not found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "InvalidParams",
"error_message": "The input parameters are not sufficient."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200
},
"data": [
{
"date": "2016-06-22",
"income_count": 1,
"income_amount": 200
},
{
"date": "2016-06-23",
"income_count": 1,
"income_amount": 200
},
]
}
Report WebservicePOST/report/webserviceTransactions.json
RequestMoney ¶
request money ¶
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"debtor": [
{
"zp": 111242,
"amount": 100
},
{
"zp": 2,
"amount": 200
}
],
"purse_number": 1,
"description": "babate pole shame dishab."
}
Schema
{
"properties" : {
"debtor" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"zp" : {
"type" : "integer",
"description" : "i want money form user"
},
"amount" : {
"type" : "integer"
}
}
},
},
"properties" : {
"purse_number" : {
"type" : "integer",
"description" : "my purse number",
}
},
"properties" : {
"description" : {
"type" : "string",
}
},
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "send request money successfully"
}
}
RequestMoneyPOST/requestMoney.json
demand ¶
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": "584fce781731d100072c5473",
"user": [
{
"zp": 1234,
"name": "user zarinpal",
"avatar": "//gravatar.com/avatar/bd3bb35bd7c5389b7a?s=128&r=g&d=mm",
"amount": 100,
"status": "pending"
},
],
"purse_number": 1,
"description": "i am need to 100 T",
"created_at": "2016-12-29 17:03:43"
}
],
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"entity_id" : {
"entity_id" : "string",
"description" : "entity id for this request money"
},
"user" : {
"type" : "object",
"properties" : {
"zp" : {
"type" : "integer"
},
"name" : {
"type" : "string",
"description" : "i want money form user"
},
"avatar" : {
"type" : "string"
},
"amount" : {
"type" : "string"
},
"status" : {
"type" : "string"
},
}
},
"purse_number" : {
"type" : "integer",
"description" : "my purse number",
},
"description" : {
"type" : "string",
},
"created_at" : {
"type" : "string",
}
}
}
}
List DemandGET/requestMoney/demand.json
List Debt ¶
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": "586510b7907b6129085e892d",
"zp": 1234,
"name": "user test",
"avatar": "//gravatar.com/avatar/d304b8d789efcfdba035a2d39f458?s=128&r=g&d=mm",
"amount": 100,
"status": "pending",
"description": "i am need 200 T",
"created_at": "2016-12-29 17:03:43"
}
]
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"entity_id" : {
"type" : "string"
},
"zp" : {
"type" : "integer"
},
"name" : {
"type" : "string"
},
"avatar" : {
"type" : "string"
},
"amount" : {
"type" : "integer"
},
"status" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"created_at" : {
"type" : "string"
},
}
}
}
List DebtGET/requestMoney/debt.json
Request Money between two user ¶
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "RequestMoneyNotFound",
"error_message": "RequestMoney Not Found."
}
}
Schema
{
"properties" : {
"entity_id" : {
"type" : "string",
"description" : "entity id for request money",
}
}
}
Request Money 2 userGET/requestMoney.json?zp=[public_id_user]
Tickets ¶
summery tickets ¶
List summary user’s tickets
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": {
"open": 1,
"unread": 2
},
"meta": {
"code": 200
}
}
Schema
{
"type": "object",
"properties": {
"open": {
"type": "integer",
"description": "open ticket's count number"
},
"unread": {
"type": "integer",
"description": "unread ticket's count number"
}
}
}
Summary TicketsGET/ticket/summary.json
list tickets ¶
List ticket of user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"title": "درخواست وبسرویس برای وبسایت test",
"ticket_department_id": 1,
"public_id": 139411070120,
"priority": "normal",
"status": "close",
"read_status": {
"first": true,
"second": null
},
"created_at": "2016-01-27 15:43:40",
"updated_at": "2016-09-24 13:26:31"
}
],
"meta": {
"code": 200,
"pagination": {
"per_page": 10,
"current_page": 1,
"links": {
"previous": null,
"next": "https://api.zarinpal.com/rest/v3/ticket/index.json?page=2"
}
}
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"ticket_department_id": {
"type": "integer",
"description": "ticket's department"
},
"public_id": {
"type": "integer"
},
"status": {
"type": "string",
"description": "ticket's status"
},
"read_status": {
"type": "object",
"properties": {
"first": {
"type" : "boolean",
"description" : "if set true it's mean user read ticket else unread"
},
"second": {
"type" : "boolean",
"description" : "if set true it's mean secound user read ticket else unread"
},
},
"created_at" : {
"type" : "string"
},
"updated_at" : {
"type" : "string"
}
}
}
}
}
List TicketsGET/ticket.json
show ticket ¶
List replies of ticket
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TicketNotFound",
"error_message": "Ticket Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"title": "درخواست وبسرویس برای وبسایت test",
"ticket_department_id": 1,
"public_id": 139411070120,
"priority": "normal",
"status": "close",
"read_status": {
"first": true,
"second": null
},
"created_at": "2016-01-27 15:43:40",
"updated_at": "2016-09-24 13:26:31",
"replies": [
{
"content": "tes",
"ip": "1.1.1.1",
"attachment": null,
"created_at": "2016-01-27 15:43:40",
"user_info": {
"name": "مسعود لطفي",
"public_id": 111242,
"email_hash": "9d8001efb3c5fcd82a73cc2e70a5"
}
}
]
}
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"ticket_department_id": {
"type": "integer",
"description": "ticket's department"
},
"public_id": {
"type": "integer"
},
"status": {
"type": "string",
"description": "ticket's status"
},
"read_status": {
"type": "object",
"properties": {
"first": {
"type" : "boolean",
"description" : "if set true it's mean user read ticket else unread"
},
"second": {
"type" : "boolean",
"description" : "if set true it's mean secound user read ticket else unread"
},
},
"created_at" : {
"type" : "string"
},
"updated_at" : {
"type" : "string"
}
}
}
}
}
show TicketGET/ticket/[ticket_entity_id].json
list department ¶
List all department
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": 2,
"name": "درخواست تاييد اطلاعات"
},
],
"meta": {
"code": 200,
},
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"entity_id" : {
"type" : "integer"
},
"name" : {
"type" : "string"
}
}
}
}
List DepartmentGET/ticket/department.json
new ticket ¶
Create new Ticket
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"title": "title of ticket",
"content": "content of ticket",
"ticket_department_id": 3,
"priority": 2
}
Schema
{
"type" : "object",
"properties" : {
"title" : {
"type" : "string",
},
"content" : {
"type" : "string",
},
"ticket_department_id" : {
"type" : "integer",
},
"priority" : {
"type" : "integer"
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "ticket create successfully."
}
}
New TicketPOST/ticket.json
reply ticket ¶
Reply new Ticket
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Schema
{
"type" : "object",
"properties" : {
"content" : {
"type" : "string",
},
"attachment" : {
"type" : "strong",
"description" : "upload file."
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "reply ticket send successfully"
}
}
Reply TicketPOST/ticket/[ticket_entity_id].json
reply Survey for ticket ¶
Survey for one Ticket
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Schema
{
"type" : "object",
"properties" : {
"content" : {
"type" : "string",
},
"speed" : {
"type" : "integer",
"description" : "Survey for ticket.This number is between 1-3"
},
"usable" : {
"type" : "integer",
"description" : "Survey for ticket.This number is between 1-3"
},
"friendly" : {
"type" : "integer",
"description" : "Survey for ticket.This number is between 1-3"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "survey send successfully"
}
}
Survey TicketPUT/ticket/[ticket_entity_id].json
close ticket ¶
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Schema
{
"type" : "object",
"properties" : {
"ticket_public_id" : {
"type" : "integer",
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TicketNotFound",
"error_message": "Ticket Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "ticket close successfully"
}
}
Create new Ticket for Guest
Close TicketPUT/ticket/close/[ticket_public_id].json
Headers
Content-Type: application/json
Body
{
"title": "api test8",
"content": "content api8",
"email": "lion.masoud@yahoo.com",
"name": "masoud lotfi",
"phone": "09351309626",
"ticket_department_id": 3,
"priority": 2
}
Schema
{
"type" : "object",
"properties" : {
"title" : {
"type" : "string",
},
"content" : {
"type" : "string",
},
"email" : {
"type" : "string",
},
"name" : {
"type" : "string",
},
"phone" : {
"type" : "string",
},
"ticket_department_id" : {
"type" : "integer",
},
"priority" : {
"type" : "integer"
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "ticket create successfully"
}
}
Find ticket guest
Create Guest TicketPOST/ticket/close/[ticket_public_id].json
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TicketNotFound",
"error_message": "Ticket Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"title": "درخواست وبسرویس برای وبسایت test",
"ticket_department_id": 1,
"public_id": 139411070120,
"priority": "normal",
"status": "close",
"read_status": {
"first": true,
"second": null
},
"created_at": "2016-01-27 15:43:40",
"updated_at": "2016-09-24 13:26:31",
"replies": [
{
"content": "tes",
"ip": "1.1.1.1",
"attachment": null,
"created_at": "2016-01-27 15:43:40",
"user_info": {
"name": "مسعود لطفي",
"phone": 09312345678,
"email_hash": "9d8001efb3c5fcd82a73cc2e70a5"
}
}
]
}
}
Reply new Ticket
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"ticket_department_id": {
"type": "integer",
"description": "ticket's department"
},
"public_id": {
"type": "integer"
},
"status": {
"type": "string",
"description": "ticket's status"
},
"read_status": {
"type": "object",
"properties": {
"first": {
"type" : "boolean",
"description" : "if set true it's mean user read ticket else unread"
},
"second": {
"type" : "boolean",
"description" : "if set true it's mean secound user read ticket else unread"
},
},
"created_at" : {
"type" : "string"
},
"updated_at" : {
"type" : "string"
}
}
}
}
}
Show Ticket GuestGET/ticket/close/[ticket_public_id].json
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Schema
{
"type" : "object",
"properties" : {
"content" : {
"type" : "string",
},
"attachment" : {
"type" : "strong",
"description" : "upload file."
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "reply ticket send successfully"
}
}
Reply Ticket GuestPOST/ticket/close/[ticket_public_id].json
Transactions ¶
transaction transfer ¶
Transfer of funds from the purse to the Card
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"card_id": "12ygjev1273wdwqdqw",
"amount": 5000,
"purse": 1
}
Schema
{
"type": "object",
"properties": {
"card_id": {
"type": "string",
"description": "card's entity id"
},
"amount": {
"type": "integer"
},
"purse": {
"type": "integer"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TransactionNotConfirmed",
"error_message": "Something went wrong, please try again."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardNotFound",
"error_message": "The selected card not found or you are not allowed to use it."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Transfer money is successfully."
}
}
Transaction TransferPOST/transaction/withdraw.json
transaction purse to purse transfer ¶
Transfer of funds from the purse to the purse
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"purse" : "1",
"zpId" : "zp.0.0",
"amount" : 5000,
"description" : "Description test",
}
Schema
{
"type" : "object",
"properties" : {
"purse" : {
"type" : "string",
"description" : "this is chose purse for sender."
},
"zpId" : {
"type" : "string",
"description" : "this is account number for receiver."
},
"amount" : {
"type" : "integer"
},
"description" : {
"type" : "integer"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TransactionNotConfirmed",
"error_message": "Something went wrong, please try again."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Transfer purse to purse is successfully"
},
"data": {
"transaction_public_id": 1
}
}
Transaction purse to purse transferPOST/transaction/p2pTransfer.json
transaction recent ¶
Show transaction recent
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "PurseNotFound",
"error_message": "Purse Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": [
{
"public_id": 32123490133,
"effective_sign": 0,
"amount": 100,
"balance": 530500,
"created": "2016-08-24 11:47:18",
"from_ip": "127.0.0.1",
"description": "test",
"confirmed": "confirmed",
"from_user": {
"public_id": 111242,
"purse": 1,
"name": "مسعود لطفي",
"avatar": "//gravatar.com/avatar/9d8001ec6fb3c5fcd82afa73cc2e70a5?s=128&r=g&d=mm"
},
"to_user": {
"public_id": 111242,
"purse": 99,
"name": "مسعود لطفي",
"avatar": "//gravatar.com/avatar/9d8001ec6fb3c5fcd82afa73cc2e70a5?s=128&r=g&d=mm"
},
"payment_type": {
"name": "خريد از درگاه"
},
"payer_info": null,
"easypay_info": null
},
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"public_id" : {
"type" : "integer"
},
"effective_sign" : {
"type" : "integer"
},
"amount" : {
"type" : "integer"
},
"balance" : {
"type" : "string"
},
"created" : {
"type" : "string"
},
"from_ip" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"confirmed" : {
"type" : "string"
},
"from_user" : {
"type" : "object",
"properties" : {
"public_id": {
"type" : "string",
},
"purse": {
"type" : "integer",
},
"name": {
"type" : "string",
},
"avatar": {
"type" : "string",
}
}
},
"to_user" : {
"type" : "object",
"properties" : {
"public_id": {
"type" : "string",
},
"purse": {
"type" : "integer",
},
"name": {
"type" : "string",
},
"avatar": {
"type" : "string",
}
}
},
"payment_type": {
"type": "object"
},
"payer_info": {
"type": "object"
},
"easypay_info": {
"type": "object"
}
}
}
}
Transaction recentGET/transaction.json?&limit=2& [purse] or [easypay_entity_id] or [webservice_entity_id]
transaction info ¶
Show transaction info
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TransactionNotFound",
"error_message": "The requested transaction not found."
}
}
Headers
Content-Type: application/json
Body
{
"data":
{
"public_id": 32123490133,
"effective_sign": 0,
"amount": 100,
"balance": 530500,
"created": "2016-08-24 11:47:18",
"from_ip": "127.0.0.1",
"description": "test",
"confirmed": "confirmed",
"from_user": {
"public_id": 111242,
"purse": 1,
"name": "مسعود لطفي",
"avatar": "//gravatar.com/avatar/9d8001ec6fb3c5fcd82afa73cc2e70a5?s=128&r=g&d=mm"
},
"to_user": {
"public_id": 111242,
"purse": 99,
"name": "مسعود لطفي",
"avatar": "//gravatar.com/avatar/9d8001ec6fb3c5fcd82afa73cc2e70a5?s=128&r=g&d=mm"
},
"payment_type": {
"name": "خريد از درگاه"
},
"payer_info": null,
"easypay_info": null
},
}
Schema
{
"type" : "object",
"properties" : {
"public_id" : {
"type" : "integer"
},
"effective_sign" : {
"type" : "integer"
},
"amount" : {
"type" : "integer"
},
"balance" : {
"type" : "string"
},
"created" : {
"type" : "string"
},
"from_ip" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"confirmed" : {
"type" : "string"
},
"from_user" : {
"type" : "object",
"properties" : {
"public_id": {
"type" : "string",
},
"purse": {
"type" : "integer",
},
"name": {
"type" : "string",
},
"avatar": {
"type" : "string",
}
}
},
"to_user" : {
"type" : "object",
"properties" : {
"public_id": {
"type" : "string",
},
"purse": {
"type" : "integer",
},
"name": {
"type" : "string",
},
"avatar": {
"type" : "string",
}
}
},
"payment_type": {
"type": "object"
},
"payer_info": {
"type": "object"
},
"easypay_info": {
"type": "object"
}
}
}
Transaction InfoGET/transaction/[transaction_public_id].json
Add Found ¶
AddFund for purse
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"card_id": "12ygjev1273wdwqdqw",
"amount": 5000,
"purse": 1,
"redirect_url": "http://www.test.com"
}
Schema
{
"type": "object",
"properties": {
"card_id": {
"type": "string",
"description": "card's entity id"
},
"amount": {
"type": "integer"
},
"purse": {
"type": "integer"
},
"redirect_url": {
"type": "integer"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TransactionInvalidPurse",
"error_message": "The purse is invalid."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TransactionInvalidCard",
"error_message": "The card is invalid."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "TransactionAmountTooSmall",
"error_message": "The minimum transfer amount is 100 tomans."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"authority": "5767cba02128e8bf1677b008"
},
"meta": {
"code": 200
}
}
Add FoundPOST/checkout/addFund.json
session info ¶
Show sessions
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": [
{
"authority": 5904,
"created_at": "2016-08-02 13:22:59",
"amount": 100,
"mobile": "09351309626",
"email": "test@example.com",
"transaction": null
},
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"authority" : {
"type" : "integer"
},
"created_at" : {
"type" : "string"
},
"amount" : {
"type" : "integer"
},
"mobile" : {
"type" : "string"
},
"email" : {
"type" : "string"
},
"transaction" : {
"type" : "object",
"properties" : {
"public_id": {
"type" : "string",
}
}
}
}
}
}
Transaction sessionGET/transaction/sessions/[webservice_enitity_id].json?fromDate=2012-1-1&toDate=2012-1-2&authority=123454321&mobile=09351309626
Users ¶
set username ¶
set user name for user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"username": "zarinpal",
"check": true
}
Schema
{
"type": "object",
"properties": {
"username": {
"type": "string"
},
"check": {
"type": "boolean",
"description": "if check set to true check user name and if check set to false set user name for user."
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "UserNameFixLate",
"error_message": "Username Fix Late . You can not change this name."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Add username successfully."
}
}
Set username for UserPOST/user/username.json
change notification ¶
Change notification for user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"income_transaction": {
"email": false,
"sms": true,
"telegram": true,
"pusher": true
},
"outgo_transaction": {
"email": false,
"sms": false,
"telegram": true,
"pusher": true
},
"new_ticket": {
"email": false,
"sms": false,
"telegram": false,
"pusher": true
},
"reply_ticket": {
"email": false,
"sms": false,
"telegram": true,
"pusher": false
},
"new_login": {
"email": true,
"sms": false,
"telegram": true,
"pusher": true
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Update notification preferences"
}
}
Change Notification for UserPUT/user/notificationPreferences.json
post Address ¶
Add address for user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"address": "tehran",
"landline": "12222222",
"postal_code": "2222222",
"geo_location": "",
"title": "home"
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Add Address successfully."
}
}
Add Address for userPOST/user/address.json
set Information ¶
set Information user
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"gender": "male",
"first_name": "مسعود",
"last_name": "لطفی",
"birthday": "1990-2-2",
"ssn": "0012557298"
}
Schema
{
"properties": {
"gender": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"birthday": {
"type": "string"
},
"ssn": {
"type": "string"
},
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "YouCanNotEditInfo",
"error_message": "You Can Not Edit Information.because this information confirmed."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Add information successfully."
}
}
Set Information UserPOST/user/information.json
upload document ¶
send upload document
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"id_card_file" : "document/14826578f6af6be.jpg",
"national_card_file" : "document/14w26578f6af6be.jpg",
"introduction_file" : "document/1482w578f6af6be.jpg",
}
Schema
{
"properties": {
"id_card_file": {
"type": "string"
},
"national_card_file": {
"type": "string"
},
"introduction_file": {
"type": "string"
},
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "All user file uploaded."
}
}
Upload DocumentPOST/user/upload.json
change email ¶
Change email
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "User email verified successfully."
}
}
Change EmailGET/user/setEmail.json
referrer users ¶
referrer users
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"name": "masoud lotfi",
"public_id": 111242,
"email_hash": "8b7bed0d4053db1ace98d194948af",
"avatar": "//gravatar.com/avatar/8b7bed0d4db1ace98d194705948af?r=g&d=mm"
}
],
}
Referrer UserGET/user/referredUsers.json
income referrer ¶
income referrer
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{}
income referrerGET/user/incomeReferrer/[user_public_id].json
Webservices ¶
list webservices ¶
Get list of current users Webservice
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": [
{
"entity_id": "4a0b7ff2-67ac-11e6-b8c295eb8fc",
"status": true,
"purse": 1,
"category_id": 10,
"tel": "09122182569",
"domain": "htpp://www.test.com",
"ip": null,
"name": "test",
"description": "description for test",
"ussd_id": null,
"zaringate_status": "NotActivated",
"logo": "//logoland.zarinpal.com/6e76cc60647c3d288631bf3ed444dd2b/125x125.png",
"meta": {
"code": 200
}
}
]
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"entity_id" : {
"type" : "string"
},
"status" : {
"type" : "boolean",
"description" : "if set status true this webservice is active else it's not Active",
},
"purse" : {
"type" : "integer"
},
"category_id" : {
"type" : "integer",
"description" : "webservice's category"
},
"tel" : {
"type" : "string"
},
"domain" : {
"type" : "string"
},
"ip" : {
"type" : "string",
"description" : "if set ip is null ,this webservice not limited else it's on limited",
},
"name" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"ussd_id" : {
"type" : "string",
"description" : "code ussd"
},
"zaringate_status" : {
"type" : "string",
"description" : "check request for zaringate"
},
"logo" : {
"type" : "string",
"description" : "This is url for show logo"
}
}
}
}
List WebservicesGET/webservice.json
new webservice ¶
Request for new webservice
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"domain": "www.test2.com",
"tel": "09351309626",
"purse": 1,
"webservice_category_id": 10,
"site_name": "test api",
"site_content": "test content for creeat webservice"
}
Schema
{
"type": "object",
"properties": {
"purse": {
"type": "integer"
},
"webservice_category_id": {
"type": "integer",
"description": "webservice's category"
},
"tel": {
"type": "string"
},
"domain": {
"type": "string"
},
"site_name": {
"type": "string"
},
"site_content": {
"type": "string"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceUniqueDomain",
"error_message": "This Domain is exists."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceFreeDomain",
"error_message": "This is a free domain."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Post request for webservice successfully"
}
}
New WebservicePOST/webservice.json
edit webservice ¶
Edit this webservice
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"purse" : 2,
"webservice_category_id" : 12,
"site_ip" : 1.1.1.1,
"site_logo" : "qwertyuiopasdfghjk",
}
Schema
{
"type" : "object",
"properties" : {
"webservice" : {
"type" : "string",
"description" : "chose webservice"
}
"purse" : {
"type" : "integer",
"description" : "chose purse for this webservice"
},
"webservice_category_id" : {
"type" : "integer",
"description" : "chose webservice category for this webservice"
},
"site_ip" : {
"type" : "string",
"description" : "this limits webservice to this ip. optional",
},
"site_logo" : {
"type" : "string",
"description" : "this is uuid for webservice",
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Update webservice successfully"
}
}
Edit WebservicePUT/webservice/[webservice_entity_id].json
show price Zaringate for all webservices ¶
Get price for request zarin gate
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"webservice": "4a0b7ff2-67ac-11e000c295eb8fc",
"amount": 20000
}
],
"meta": {
"code": 200
}
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"webservice" : {
"type" : "string",
"description" : "webservice's entity_id"
},
"amount" : {
"type" : "integer",
"description" : "price zaringate for this webservice",
}
}
}
}
PRICE REQUEST ZARINGATEGET/webservice/priceZaringate.json
show price Ussd for all webservices ¶
Get price for ussd
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"webservice": "4a0b7ff2-67ac-11e000c295eb8fc",
"amount": 20000
}
],
"meta": {
"code": 200
}
}
Schema
{
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"webservice" : {
"type" : "string",
"description" : "webservice's entity_id"
},
"amount" : {
"type" : "integer",
"description" : "price ussd for this webservice",
}
}
}
}
PRICE USSDGET/webservice/priceUssd.json
post request zaringate ¶
new Zaringate
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"webservice": "e45d421e-3dd8-11e6-9399-0800279114ca",
"purse": 1
}
Schema
{
"type": "object",
"properties": {
"webservice": {
"type": "string",
"description": "request for this webservice."
},
"purse": {
"type": "integer"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Send request for zarin gate successfully"
}
}
New ZaringatePOST/webservice/requestZaringate.json
post request ussd ¶
Request new USSD
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"webservice": "e45d421e-3dd8-11e6-9399-0800279114ca",
"purse": 1,
"ussd_id": 12345
}
Schema
{
"type": "object",
"properties": {
"webservice": {
"type": "string",
"description": "request for this webservice."
},
"purse": {
"type": "integer"
},
"ussd_id": {
"type": "string",
"description": "ussd code"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Add ussd successfully"
}
}
Request New USSDPOST/webservice/requestUssd.json
list WebserviceCategory ¶
Get list of WebserviceCategory
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": [
{
"public_id": 1,
"title": "خدمات اینترنت",
"parent_id": null
}
],
"meta": {
"code": 200
}
}
Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"public_id": {
"type": "integer"
},
"title": {
"type": "string"
},
"parent_id": {
"type": "integer",
"description": "for dropdown lists"
},
"category_id": {
"type": "integer",
"description": "webservice's category"
}
}
}
}
List WebserviceCategoryGET/webservice/category.json
delete webservice ¶
delete this webservice
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WebserviceNotFound",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "This Webservice delete successfully"
}
}
Delete WebserviceDELETE/webservice/[webservic_entity_id].json
Trust logo ¶
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "webserviceNotConfirm",
"error_message": "Webservice Not Found."
}
}
Headers
Content-Type: application/json
Body
{
"data": [
{
"domain": "test.ir",
"name": "test",
"updated": "2016-10-08 15:41:41",
"logo": "//logoland.zarinpal.com/0ec15027fa4a8634fd16b5988a/125x125.png"
}
],
"meta": {
"code": 200
}
}
Schema
{
"type": "object",
"properties": {
"domain": {
"type": "string"
},
"name": {
"type": "string"
},
"updated": {
"type": "string"
},
"logo": {
"type": "string"
}
}
}
Trust LogoGET/verifyWebsite/[domain].json
Zarincard ¶
zarincard holderName ¶
Get the owner name, bank name, bank Sheba Id of the card
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "invalidDestinationPan",
"error_message": "Destination pan is invalid."
}
}
Headers
Content-Type: application/json
Body
{
"data": {
"holder_name": "کاربر ۱",
"bank_info": {
"name": "xxxxx",
"slug": "xxxxx",
"sheba_id": "###"
}
},
"meta": {
"code": 200,
}
}
Schema
{
"type" : "object",
"properties" : {
"holder_name" : {
"type" : "string",
"description" : "user's name."
},
"bank_info" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"description" : "bank's name."
},
"slug" : {
"type" : "string",
"description" : "bank's slug."
},
"sheba_id" : {
"type" : "string",
"description" : "banks's sheba_id."
}
}
}
}
}
Zarincard HolderNameGET/zarincard/holderName/[destination_pan].json
zarincard getCost ¶
Get cost zarincard and coupon
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Headers
Content-Type: application/json
Body
{
"data": {
"cost": 49500,
"coupon": null
},
"meta": {
"code": 200
}
}
Schema
{
"type" : "object",
"properties" : {
"cost" : {
"type" : "integer",
},
"coupon" : {
"type" : "string",
}
}
}
Zarincard GetCostGET/zarincard/cost.json
zarincard statement ¶
Get statement for Zarincard
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"card_id": "bvcxzsdfghjiuytr3ffgjhgffg",
"password": "123456",
"cvv2": "1234"
}
Schema
{
"type": "object",
"properties": {
"card_id": {
"type": "string",
"description": "zarincard's entity id"
},
"password": {
"type": "string"
},
"cvv2": {
"type": "string"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WrongCredentials",
"error_message": "Wrong password or cvv2."
}
}
Headers
Content-Type: application/json
Body
{
"data":
{
"balance": 475329,
"statement":
{
"amount": 2000,
"time": "94/10/13",
"description": "خريد اینترنتی"
}
"meta": {
"code": 200
}
}
}
Schema
{
"type": "object",
"properties": {
"balance": {
"type": "integer"
},
"balance": {
"type": "object",
"properties": {
"amount" : {
"type" : "integer"
},
"time" : {
"type" : "string"
},
"description" : {
"type" : "string"
}
}
}
}
}
Statement ZarincardPOST/zarincard/statement.json
transfer shetab ¶
Transfer to shetab
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"card_id": "################",
"password": "######",
"cvv2": "####",
"dst_pan": "################",
"amount": "#####"
}
Schema
{
"type": "object",
"properties": {
"card_id": {
"type": "string",
"description": "zarincard's entity id"
},
"password": {
"type": "string"
},
"cvv2": {
"type": "string"
},
"dst_pan": {
"type": "string",
"description": "card's pan for receiver"
},
"amount": {
"type": "string"
}
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "WrongCredentials",
"error_message": "Wrong password or cvv2."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "CardNotFound",
"error_message": "The selected card not found or you are not allowed to use it."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "AmountTooSmall",
"error_message": "Amount is too small."
}
}
Headers
Content-Type: application/json
Body
{
"data":
{
"ref_id": "########",
"date": "####-##-## ##:##:##",
"card_balance": ######,
"dst_card_pan": "################",
"dst_card_holder_name": "xxxxxxx",
"transfer_amount": "####",
"meta": {
"code": 200
}
}
}
Schema
{
"type": "object",
"properties": {
"ref_id": {
"type": "string",
"description" : "ref number for this transaction."
},
"date": {
"type": "string"
},
"card_balance": {
"type": "string",
"description" : "card's balance."
},
"dst_card_pan": {
"type": "string",
"description" : "card's pan for receiver"
},
"dst_card_holder_name": {
"type": "string",
"description" : "user's name for receiver"
},
"transfer_amount": {
"type": "string",
"description" : "transaction's amount."
}
}
}
Transfer shetabPOST/zarincard/transferShetab.json
requestIssue ¶
Perform requesting zarincard
Headers
Content-Type: application/json
Authorization: Bearer [access_token]
Body
{
"purse_number" : 1,
"coupon" : 'test',
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 400,
"error_type": "'ZarinCardUnknownError'",
"error_message": "Unknown error."
}
}
Headers
Content-Type: application/json
Body
{
"meta": {
"code": 200,
"message": "Your request has been successfully submitted."
}
}
Zarincard requestIssuePOST/zarincard/requestIssue.json
Generated by aglio on 25 Jun 2017