API Integration

Table of Contents

Authentication

API Reference

The ZazPay API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication , which can be understood by off-the-shelf HTTP clients. Depend on request format JSON or XML will be returned in all responses from the API, including errors.

Authenticating to the API

ALL API request must call with standard HTTP Basic Authentication. To use it, simply pass the merchant ID as username and API Key as password. You can get Merchant ID and API key in your dashboard (please refer).

Authentication Arguments

username
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
Password
Required API key provided by ZazPay in your dashboard page.

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/payment/{payment_id}.json
	-u {merchant_id}:xxxxxAPIKeyxxxxx

Current Plan Details

Retrieve current subscription plan of the merchant.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.

URL

GET api/v1/merchants/{merchant_id}/websites/{website_id}/plan

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/plan.json

Example Responses

  	 {
		"id": 1,
		"name": "Enterprise",
		"brand": "Any Branding",
		"start_date": "2013-07-22T10:11:00+05:30",
		"end_date": "2013-08-22T10:11:00+05:30",
		"allowed_transaction_limit": 4000,
		"current_transaction_count": 21,
		"current_transaction_amount": 1138
	}

   

Gateways Listing

Retrieve the gateways list enabled by merchant.

Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
supported_countries
Optional Comma separated value of country code.
supported_languages
Optional Comma separated value of language code.
supported_currencies
Optional Comma separated value of currency code.
supported_actions
Optional Comma separated value of action name.
maximum_payable_amount
Optional Maximum payable amount.
valid_capture_period
Optional Valid capture period.
is_capture_guarantee
Optional true/false
return_metadata
OptionalTrue/False. Default is False
preferred_gateways
OptionalComma separated value of gateway id. You can get gateway id from payment gateways listing page.

URL

GET api/v1/merchants/{merchant_id}/websites/{website_id}/gateways?supported_countries=IN,US&supported_languages=en,es&supported_currencies=USD,EUR&maximum_payable_ amount=1000&valid_capture_period=90&is_capture_guarantee=true&supported_actions=auth,marketplace-auth

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/gateways.json?supported_countries=IN,US&supported_languages=en,es&supported_currencies=USD,EUR&maximum_payable_amount=1000&valid_capture_period=90&is_capture_guarantee=true&supported_actions=auth,capture,marketplace-auth&return_metadata=true

Example Responses

	    	{
	    "_metadata": {
	        "page": 1,
	        "page_count": 1,
	        "total_count": 4,
	        "Links": [
	            {
	                "self": "/merchants/9418/gateways.json?page=1"
	            },
	            {
	                "first": "/merchants/9418/gateways.json?page=1"
	            },
	            {
	                "previous": ""
	            },
	            {
	                "next": ""
	            },
	            {
	                "last": "/merchants/9418/gateways.json?page=1"
	            }
	        ]
	    },
	    "gateways": [
	        {
	            "id": 4922,
	            "name": "Credit & Debit Cards",
	            "display_name": "Credit & Debit Cards",
	            "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/4922-large.4ac30e6df33dfbdd1b15b39989ce879a.png",
	            "gateways": [
	                {
	                    "id": 2504,
	                    "name": "Balanced",
	                    "display_name": "Balanced",
	                    "connect_instruction": "This will take you to <a target=\"_blank\" rel=\"nofollow\"  href=\"http://stripe.com/\">stripe.com</a> to enter your login details. Note that it is done using official Stripe  API and so your details are in safe and your login details are never shared with us by Stripe. ",
	                    "_form_fields": {
	                        "_extends_tpl": [
	                            "buyer",
	                            "credit_card"
	                        ],
	                        "_extends_connect_tpl": [
	                            "bank"
	                        ],
	                        "_html5": "",
	                        "_fields": {}
	                    },
	                    "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/2504-large.817fd939263ef5e094ba462fb3b38dcd.png",
	                    "supported_features": [
	                        {
	                            "actions": [
	                                "Marketplace-Capture"
	                            ],
	                            "currencies": [
	                                "USD"
	                            ],
	                            "countries": [
	                                "US"
	                            ],
	                            "languages": [
	                                "en"
	                            ],
	                            "card_types": [
	                                "Credit Card",
	                                "Debit Card"
	                            ],
	                            "services": [
	                                "PC-to-phone service or SMS",
	                                "Telephone service",
	                                "VoIP",
	                                "horticultural products"
	                            ],
	                            "credit_card_types": [
	                                "American",
	                                "Master",
	                                "Visa"
	                            ]
	                        }
	                    ],
	                    "buyer_fees_formula": "((amount * 100) +0.0)/100",
	                    "buyer_fees_payer_confirmation_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	                    "valid_capture_period": "0",
	                    "valid_capture_period_for_hundred_per": "0"
	                }
	            ]
	        },
	        {
	            "id": 5333,
	            "name": "Electronic Gateways",
	            "display_name": "Electronic Gateways",
	            "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/5333-large.b3f1c5c18b603dfdf9d02e19efa49683.png",
	            "gateways": [
	                {
	                    "id": 6012,
	                    "name": "LG U+",
	                    "display_name": "LG U+",
	                    "_form_fields": {
	                        "_extends_tpl": [
	                            "buyer"
	                        ],
	                        "_html5": "",
	                        "_fields": {}
	                    },
	                    "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/6012-large.8a3a57721b8915830b9959e22081098b.png",
	                    "supported_features": [
	                        {
	                            "actions": [
	                                "Auth",
	                                "Void"
	                            ],
	                            "currencies": [
	                                "USD"
	                            ],
	                            "countries": [
	                                "KR"
	                            ],
	                            "languages": [
	                                "ko"
	                            ],
	                            "card_types": [],
	                            "services": [
	                                "PC-to-phone service or SMS",
	                                "horticultural products"
	                            ],
	                            "credit_card_types": []
	                        }
	                    ],
	                    "buyer_fees_formula": "((amount * 100) +0.0)/100",
	                    "buyer_fees_payer_confirmation_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	                    "valid_capture_period": "0",
	                    "valid_capture_period_for_hundred_per": "0"
	                },
	                {
	                    "id": 6005,
	                    "name": "EBS",
	                    "display_name": "EBS",
	                    "_form_fields": {
	                        "_extends_tpl": [
	                            "buyer"
	                        ],
	                        "_html5": "",
	                        "_fields": {}
	                    },
	                    "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/6005-large.b2e2ff9ec54a8a5db4eee7e47c1a7e6c.png",
	                    "supported_features": [
	                        {
	                            "actions": [
	                                "Auth"
	                            ],
	                            "currencies": [
	                                "AUD",
	                                "BRL",
	                                "CAD",
	                                "CHF",
	                                "CZK",
	                                "DKK",
	                                "EUR",
	                                "GBP",
	                                "HKD",
	                                "HUF",
	                                "ILS",
	                                "INR",
	                                "INR",
	                                "JPY",
	                                "MXN",
	                                "MYR",
	                                "NOK",
	                                "NZD",
	                                "PHP",
	                                "PLN",
	                                "SEK",
	                                "SGD",
	                                "THB",
	                                "TRY",
	                                "TWD",
	                                "USD"
	                            ],
	                            "countries": [
	                                "AD",
	                                "AE",
	                                "AF",
	                                "AG",
	                                "AI",
	                                "AL",
	                                "AM",
	                                "AN",
	                                "AO",
	                                "AQ",
	                                "AR",
	                                "AS",
	                                "AT",
	                                "AU",
	                                "AW",
	                                "AX",
	                                "AZ",
	                                "BA",
	                                "BB",
	                                "BD",
	                                "BE",
	                                "BF",
	                                "BG",
	                                "BH",
	                                "BI",
	                                "BJ",
	                                "BL",
	                                "BM",
	                                "BN",
	                                "BO",
	                                "BQ",
	                                "BR",
	                                "BS",
	                                "BT",
	                                "BV",
	                                "BW",
	                                "BY",
	                                "BZ",
	                                "CA",
	                                "CC",
	                                "CD",
	                                "CF",
	                                "CG",
	                                "CH",
	                                "CI",
	                                "CK",
	                                "CL",
	                                "CM",
	                                "CN",
	                                "CO",
	                                "CR",
	                                "CS",
	                                "CU",
	                                "CV",
	                                "CW",
	                                "CX",
	                                "CY",
	                                "CZ",
	                                "DE",
	                                "DJ",
	                                "DK",
	                                "DM",
	                                "DO",
	                                "DZ",
	                                "EC",
	                                "EE",
	                                "EG",
	                                "EH",
	                                "ER",
	                                "ES",
	                                "ET",
	                                "FI",
	                                "FJ",
	                                "FK",
	                                "FM",
	                                "FO",
	                                "FR",
	                                "GA",
	                                "GB",
	                                "GD",
	                                "GE",
	                                "GF",
	                                "GG",
	                                "GH",
	                                "GI",
	                                "GL",
	                                "GM",
	                                "GN",
	                                "GP",
	                                "GQ",
	                                "GR",
	                                "GS",
	                                "GT",
	                                "GU",
	                                "GW",
	                                "GY",
	                                "HK",
	                                "HM",
	                                "HN",
	                                "HR",
	                                "HT",
	                                "HU",
	                                "ID",
	                                "IE",
	                                "IL",
	                                "IM",
	                                "IN",
	                                "IO",
	                                "IQ",
	                                "IR",
	                                "IS",
	                                "IT",
	                                "JE",
	                                "JM",
	                                "JO",
	                                "JP",
	                                "KE",
	                                "KG",
	                                "KH",
	                                "KI",
	                                "KM",
	                                "KN",
	                                "KP",
	                                "KR",
	                                "KW",
	                                "KY",
	                                "KZ",
	                                "LA",
	                                "LB",
	                                "LC",
	                                "LI",
	                                "LK",
	                                "LR",
	                                "LS",
	                                "LT",
	                                "LU",
	                                "LV",
	                                "LY",
	                                "MA",
	                                "MC",
	                                "MD",
	                                "ME",
	                                "MF",
	                                "MG",
	                                "MH",
	                                "MK",
	                                "ML",
	                                "MM",
	                                "MN",
	                                "MO",
	                                "MP",
	                                "MQ",
	                                "MR",
	                                "MS",
	                                "MT",
	                                "MU",
	                                "MV",
	                                "MW",
	                                "MX",
	                                "MY",
	                                "MZ",
	                                "NA",
	                                "NC",
	                                "NE",
	                                "NF",
	                                "NG",
	                                "NI",
	                                "NL",
	                                "NO",
	                                "NP",
	                                "NR",
	                                "NU",
	                                "NZ",
	                                "OM",
	                                "PA",
	                                "PE",
	                                "PF",
	                                "PG",
	                                "PH",
	                                "PK",
	                                "PL",
	                                "PM",
	                                "PN",
	                                "PR",
	                                "PS",
	                                "PT",
	                                "PW",
	                                "PY",
	                                "QA",
	                                "RE",
	                                "RO",
	                                "RS",
	                                "RU",
	                                "RW",
	                                "SA",
	                                "SB",
	                                "SC",
	                                "SD",
	                                "SE",
	                                "SG",
	                                "SH",
	                                "SI",
	                                "SJ",
	                                "SK",
	                                "SL",
	                                "SM",
	                                "SN",
	                                "SO",
	                                "SR",
	                                "SS",
	                                "ST",
	                                "SV",
	                                "SX",
	                                "SY",
	                                "SZ",
	                                "TC",
	                                "TD",
	                                "TF",
	                                "TG",
	                                "TH",
	                                "TJ",
	                                "TK",
	                                "TL",
	                                "TM",
	                                "TN",
	                                "TO",
	                                "TR",
	                                "TT",
	                                "TV",
	                                "TW",
	                                "TZ",
	                                "UA",
	                                "UG",
	                                "UM",
	                                "US",
	                                "UY",
	                                "UZ",
	                                "VA",
	                                "VC",
	                                "VE",
	                                "VG",
	                                "VI",
	                                "VN",
	                                "VU",
	                                "WF",
	                                "WS",
	                                "XK",
	                                "YE",
	                                "YT",
	                                "ZA",
	                                "ZM",
	                                "ZW"
	                            ],
	                            "languages": [
	                                "aa",
	                                "ab",
	                                "ae",
	                                "af",
	                                "ak",
	                                "am",
	                                "an",
	                                "ar",
	                                "as",
	                                "av",
	                                "ay",
	                                "az",
	                                "ba",
	                                "be",
	                                "bg",
	                                "bh",
	                                "bi",
	                                "bm",
	                                "bn",
	                                "bo",
	                                "br",
	                                "bs",
	                                "ca",
	                                "ce",
	                                "ch",
	                                "co",
	                                "cr",
	                                "cs",
	                                "cu",
	                                "cv",
	                                "cy",
	                                "da",
	                                "de",
	                                "dv",
	                                "dz",
	                                "ee",
	                                "el",
	                                "en",
	                                "eo",
	                                "es",
	                                "et",
	                                "eu",
	                                "fa",
	                                "ff",
	                                "fi",
	                                "fj",
	                                "fo",
	                                "fr",
	                                "fy",
	                                "ga",
	                                "gd",
	                                "gl",
	                                "gn",
	                                "gu",
	                                "gv",
	                                "ha",
	                                "he",
	                                "hi",
	                                "ho",
	                                "hr",
	                                "ht",
	                                "hu",
	                                "hy",
	                                "hz",
	                                "ia",
	                                "id",
	                                "ie",
	                                "ig",
	                                "ii",
	                                "ik",
	                                "io",
	                                "is",
	                                "it",
	                                "iu",
	                                "ja",
	                                "jv",
	                                "ka",
	                                "kg",
	                                "ki",
	                                "kj",
	                                "kk",
	                                "kl",
	                                "km",
	                                "kn",
	                                "ko",
	                                "kr",
	                                "ks",
	                                "ku",
	                                "kv",
	                                "kw",
	                                "ky",
	                                "la",
	                                "lb",
	                                "lg",
	                                "li",
	                                "ln",
	                                "lo",
	                                "lt",
	                                "lu",
	                                "lv",
	                                "mg",
	                                "mh",
	                                "mi",
	                                "mk",
	                                "ml",
	                                "mn",
	                                "mr",
	                                "ms",
	                                "mt",
	                                "my",
	                                "na",
	                                "nb",
	                                "nd",
	                                "ne",
	                                "ng",
	                                "nl",
	                                "nn",
	                                "no",
	                                "nr",
	                                "nv",
	                                "ny",
	                                "oc",
	                                "oj",
	                                "om",
	                                "or",
	                                "os",
	                                "pa",
	                                "pi",
	                                "pl",
	                                "ps",
	                                "pt",
	                                "qu",
	                                "rm",
	                                "rn",
	                                "ro",
	                                "ru",
	                                "rw",
	                                "sa",
	                                "sc",
	                                "sd",
	                                "se",
	                                "sg",
	                                "si",
	                                "sk",
	                                "sl",
	                                "sm",
	                                "sn",
	                                "so",
	                                "sq",
	                                "sr",
	                                "ss",
	                                "st",
	                                "su",
	                                "sv",
	                                "sw",
	                                "ta",
	                                "te",
	                                "tg",
	                                "th",
	                                "ti",
	                                "tk",
	                                "tl",
	                                "tn",
	                                "to",
	                                "tr",
	                                "ts",
	                                "tt",
	                                "tw",
	                                "ty",
	                                "ug",
	                                "uk",
	                                "ur",
	                                "uz",
	                                "ve",
	                                "vi",
	                                "vo",
	                                "wa",
	                                "wo",
	                                "xh",
	                                "yi",
	                                "yo",
	                                "za",
	                                "zh",
	                                "zh-TW",
	                                "zu"
	                            ],
	                            "card_types": [
	                                "Credit Card",
	                                "Debit Card"
	                            ],
	                            "services": [],
	                            "credit_card_types": [
	                                "American",
	                                "Master",
	                                "Visa"
	                            ]
	                        }
	                    ],
	                    "buyer_fees_formula": "((amount * 100) +0.0)/100",
	                    "buyer_fees_payer_confirmation_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	                    "valid_capture_period": "0",
	                    "valid_capture_period_for_hundred_per": "0"
	                },
	                {
	                    "id": 6009,
	                    "name": "VoguePay",
	                    "display_name": "VoguePay",
	                    "_form_fields": {
	                        "_extends_tpl": [
	                            "buyer"
	                        ],
	                        "_html5": "",
	                        "_fields": {}
	                    },
	                    "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/6009-large.a9cf4f2697e0892277981e1fba8b86fa.png",
	                    "supported_features": [
	                        {
	                            "actions": [
	                                "Capture"
	                            ],
	                            "currencies": [
	                                "NGN"
	                            ],
	                            "countries": [
	                                "NG"
	                            ],
	                            "languages": [
	                                "en"
	                            ],
	                            "card_types": [
	                                "Credit Card",
	                                "Debit Card"
	                            ],
	                            "services": [
	                                "PC-to-phone service or SMS",
	                                "Telephone service",
	                                "VoIP",
	                                "horticultural products"
	                            ],
	                            "credit_card_types": [
	                                "American",
	                                "Master",
	                                "Visa"
	                            ]
	                        }
	                    ],
	                    "buyer_fees_formula": "((amount * 100) +0.0)/100",
	                    "buyer_fees_payer_confirmation_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	                    "valid_capture_period": "0",
	                    "valid_capture_period_for_hundred_per": "0"
	                },
	                {
	                    "id": 6006,
	                    "name": "Pagseguro",
	                    "display_name": "Pagseguro",
	                    "_form_fields": {
	                        "_extends_tpl": [
	                            "buyer"
	                        ],
	                        "_html5": "",
	                        "_fields": {}
	                    },
	                    "thumb_url": "//d1fhd8b1ym2gwa.cloudfront.net/gateways/6006-large.ec159d4f05e0b7cb30392a95ac8681c3.png",
	                    "supported_features": [
	                        {
	                            "actions": [
	                                "Capture"
	                            ],
	                            "currencies": [
	                                "BRL"
	                            ],
	                            "countries": [
	                                "AD",
	                                "AE",
	                                "AF",
	                                "AG",
	                                "AI",
	                                "AL",
	                                "AM",
	                                "AN",
	                                "AO",
	                                "AQ",
	                                "AR",
	                                "AS",
	                                "AT",
	                                "AU",
	                                "AW",
	                                "AX",
	                                "AZ",
	                                "BA",
	                                "BB",
	                                "BD",
	                                "BE",
	                                "BF",
	                                "BG",
	                                "BH",
	                                "BI",
	                                "BJ",
	                                "BL",
	                                "BM",
	                                "BN",
	                                "BO",
	                                "BQ",
	                                "BR",
	                                "BS",
	                                "BT",
	                                "BV",
	                                "BW",
	                                "BY",
	                                "BZ",
	                                "CA",
	                                "CC",
	                                "CD",
	                                "CF",
	                                "CG",
	                                "CH",
	                                "CI",
	                                "CK",
	                                "CL",
	                                "CM",
	                                "CN",
	                                "CO",
	                                "CR",
	                                "CS",
	                                "CU",
	                                "CV",
	                                "CW",
	                                "CX",
	                                "CY",
	                                "CZ",
	                                "DE",
	                                "DJ",
	                                "DK",
	                                "DM",
	                                "DO",
	                                "DZ",
	                                "EC",
	                                "EE",
	                                "EG",
	                                "EH",
	                                "ER",
	                                "ES",
	                                "ET",
	                                "FI",
	                                "FJ",
	                                "FK",
	                                "FM",
	                                "FO",
	                                "FR",
	                                "GA",
	                                "GB",
	                                "GD",
	                                "GE",
	                                "GF",
	                                "GG",
	                                "GH",
	                                "GI",
	                                "GL",
	                                "GM",
	                                "GN",
	                                "GP",
	                                "GQ",
	                                "GR",
	                                "GS",
	                                "GT",
	                                "GU",
	                                "GW",
	                                "GY",
	                                "HK",
	                                "HM",
	                                "HN",
	                                "HR",
	                                "HT",
	                                "HU",
	                                "ID",
	                                "IE",
	                                "IL",
	                                "IM",
	                                "IN",
	                                "IO",
	                                "IQ",
	                                "IR",
	                                "IS",
	                                "IT",
	                                "JE",
	                                "JM",
	                                "JO",
	                                "JP",
	                                "KE",
	                                "KG",
	                                "KH",
	                                "KI",
	                                "KM",
	                                "KN",
	                                "KP",
	                                "KR",
	                                "KW",
	                                "KY",
	                                "KZ",
	                                "LA",
	                                "LB",
	                                "LC",
	                                "LI",
	                                "LK",
	                                "LR",
	                                "LS",
	                                "LT",
	                                "LU",
	                                "LV",
	                                "LY",
	                                "MA",
	                                "MC",
	                                "MD",
	                                "ME",
	                                "MF",
	                                "MG",
	                                "MH",
	                                "MK",
	                                "ML",
	                                "MM",
	                                "MN",
	                                "MO",
	                                "MP",
	                                "MQ",
	                                "MR",
	                                "MS",
	                                "MT",
	                                "MU",
	                                "MV",
	                                "MW",
	                                "MX",
	                                "MY",
	                                "MZ",
	                                "NA",
	                                "NC",
	                                "NE",
	                                "NF",
	                                "NG",
	                                "NI",
	                                "NL",
	                                "NO",
	                                "NP",
	                                "NR",
	                                "NU",
	                                "NZ",
	                                "OM",
	                                "PA",
	                                "PE",
	                                "PF",
	                                "PG",
	                                "PH",
	                                "PK",
	                                "PL",
	                                "PM",
	                                "PN",
	                                "PR",
	                                "PS",
	                                "PT",
	                                "PW",
	                                "PY",
	                                "QA",
	                                "RE",
	                                "RO",
	                                "RS",
	                                "RU",
	                                "RW",
	                                "SA",
	                                "SB",
	                                "SC",
	                                "SD",
	                                "SE",
	                                "SG",
	                                "SH",
	                                "SI",
	                                "SJ",
	                                "SK",
	                                "SL",
	                                "SM",
	                                "SN",
	                                "SO",
	                                "SR",
	                                "SS",
	                                "ST",
	                                "SV",
	                                "SX",
	                                "SY",
	                                "SZ",
	                                "TC",
	                                "TD",
	                                "TF",
	                                "TG",
	                                "TH",
	                                "TJ",
	                                "TK",
	                                "TL",
	                                "TM",
	                                "TN",
	                                "TO",
	                                "TR",
	                                "TT",
	                                "TV",
	                                "TW",
	                                "TZ",
	                                "UA",
	                                "UG",
	                                "UM",
	                                "US",
	                                "UY",
	                                "UZ",
	                                "VA",
	                                "VC",
	                                "VE",
	                                "VG",
	                                "VI",
	                                "VN",
	                                "VU",
	                                "WF",
	                                "WS",
	                                "XK",
	                                "YE",
	                                "YT",
	                                "ZA",
	                                "ZM",
	                                "ZW"
	                            ],
	                            "languages": [
	                                "aa",
	                                "ab",
	                                "ae",
	                                "af",
	                                "ak",
	                                "am",
	                                "an",
	                                "ar",
	                                "as",
	                                "av",
	                                "ay",
	                                "az",
	                                "ba",
	                                "be",
	                                "bg",
	                                "bh",
	                                "bi",
	                                "bm",
	                                "bn",
	                                "bo",
	                                "br",
	                                "bs",
	                                "ca",
	                                "ce",
	                                "ch",
	                                "co",
	                                "cr",
	                                "cs",
	                                "cu",
	                                "cv",
	                                "cy",
	                                "da",
	                                "de",
	                                "dv",
	                                "dz",
	                                "ee",
	                                "el",
	                                "en",
	                                "eo",
	                                "es",
	                                "et",
	                                "eu",
	                                "fa",
	                                "ff",
	                                "fi",
	                                "fj",
	                                "fo",
	                                "fr",
	                                "fy",
	                                "ga",
	                                "gd",
	                                "gl",
	                                "gn",
	                                "gu",
	                                "gv",
	                                "ha",
	                                "he",
	                                "hi",
	                                "ho",
	                                "hr",
	                                "ht",
	                                "hu",
	                                "hy",
	                                "hz",
	                                "ia",
	                                "id",
	                                "ie",
	                                "ig",
	                                "ii",
	                                "ik",
	                                "io",
	                                "is",
	                                "it",
	                                "iu",
	                                "ja",
	                                "jv",
	                                "ka",
	                                "kg",
	                                "ki",
	                                "kj",
	                                "kk",
	                                "kl",
	                                "km",
	                                "kn",
	                                "ko",
	                                "kr",
	                                "ks",
	                                "ku",
	                                "kv",
	                                "kw",
	                                "ky",
	                                "la",
	                                "lb",
	                                "lg",
	                                "li",
	                                "ln",
	                                "lo",
	                                "lt",
	                                "lu",
	                                "lv",
	                                "mg",
	                                "mh",
	                                "mi",
	                                "mk",
	                                "ml",
	                                "mn",
	                                "mr",
	                                "ms",
	                                "mt",
	                                "my",
	                                "na",
	                                "nb",
	                                "nd",
	                                "ne",
	                                "ng",
	                                "nl",
	                                "nn",
	                                "no",
	                                "nr",
	                                "nv",
	                                "ny",
	                                "oc",
	                                "oj",
	                                "om",
	                                "or",
	                                "os",
	                                "pa",
	                                "pi",
	                                "pl",
	                                "ps",
	                                "pt",
	                                "qu",
	                                "rm",
	                                "rn",
	                                "ro",
	                                "ru",
	                                "rw",
	                                "sa",
	                                "sc",
	                                "sd",
	                                "se",
	                                "sg",
	                                "si",
	                                "sk",
	                                "sl",
	                                "sm",
	                                "sn",
	                                "so",
	                                "sq",
	                                "sr",
	                                "ss",
	                                "st",
	                                "su",
	                                "sv",
	                                "sw",
	                                "ta",
	                                "te",
	                                "tg",
	                                "th",
	                                "ti",
	                                "tk",
	                                "tl",
	                                "tn",
	                                "to",
	                                "tr",
	                                "ts",
	                                "tt",
	                                "tw",
	                                "ty",
	                                "ug",
	                                "uk",
	                                "ur",
	                                "uz",
	                                "ve",
	                                "vi",
	                                "vo",
	                                "wa",
	                                "wo",
	                                "xh",
	                                "yi",
	                                "yo",
	                                "za",
	                                "zh",
	                                "zh-TW",
	                                "zu"
	                            ],
	                            "card_types": [
	                                "Credit Card",
	                                "Debit Card"
	                            ],
	                            "services": [
	                                "PC-to-phone service or SMS",
	                                "Telephone service",
	                                "VoIP",
	                                "horticultural products"
	                            ],
	                            "credit_card_types": [
	                                "American",
	                                "Master",
	                                "Visa"
	                            ]
	                        }
	                    ],
	                    "buyer_fees_formula": "((amount * 100) +0.0)/100",
	                    "buyer_fees_payer_confirmation_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	                    "valid_capture_period": "0",
	                    "valid_capture_period_for_hundred_per": "0"
	                }
	            ],
	            "_form_fields_tpls": {
	                "buyer": {
	                    "_html5": "<input name=\"buyer_email\" id=\"buyer_email\" type=\"email\"  placeholder=\"Email\" required />\r\n<input name=\"buyer_address\"id=\"buyer_address\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Address\" required />\r\n<input name=\"buyer_city\"id=\"buyer_city\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"City\" required />\r\n<input name=\"buyer_state\"id=\"buyer_state\" type=\"text\" placeholder=\"State\" />\r\n<input name=\"buyer_country\"id=\"buyer_country\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"ISO2 Country Code\" required />\r\n<input name=\"buyer_zip_code\"id=\"buyer_zip_code\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Zip Code\" required />\r\n<input name=\"buyer_phone\"id=\"buyer_phone\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Phone\" required />\r\n",
	                    "_fields": {
	                        "buyer_email": {
	                            "required": true
	                        },
	                        "buyer_address": {
	                            "required": true
	                        },
	                        "buyer_city": {
	                            "required": true
	                        },
	                        "buyer_state": {
	                            "required": false
	                        },
	                        "buyer_country": {
	                            "required": true
	                        },
	                        "buyer_zip_code": {
	                            "required": true
	                        },
	                        "buyer_phone": {
	                            "required": true
	                        }
	                    }
	                },
	                "credit_card": {
	                    "_html5": "<input name=\"credit_card_number\" id=\"credit_card_number\" type=\"text\"  class=\"cc-number\" placeholder=\"Card Number\" required/>\r\n<input name=\"credit_card_expire\" id=\"credit_card_expire\" type=\"text\"  class=\"cc-exp\" placeholder=\"Expires (MM/YY)\" required/>\r\n<input name=\"credit_card_name_on_card\" id=\"credit_card_name_on_card\" type=\"text\"  class=\"card_name\" placeholder=\"Name on Card\" required/>\r\n<input name=\"credit_card_code\" id=\"credit_card_code\" type=\"text\"  class=\"cc-cvc\" placeholder=\"Card Code\" required/>\r\n",
	                    "_fields": {
	                        "credit_card_number": {
	                            "required": true
	                        },
	                        "credit_card_expire": {
	                            "required": true
	                        },
	                        "credit_card_name_on_card": {
	                            "required": true
	                        },
	                        "credit_card_code": {
	                            "required": true
	                        }
	                    }
	                },
	                "manual": {
	                    "_html5": "<textarea name=\"payment_note\" id=\"payment_note\" type=\"text\" placeholder=\"Payment Note\" required></textarea>\r\n",
	                    "_fields": {
	                        "payment_note": {
	                            "required": true
	                        }
	                    }
	                },
	                "bank": {
	                    "_html5": "<h3>Who are you?</h3><input type=\"radio\" name=\"persontype\" id=\"persontype\" value=\"Person\" checked=\"checked\"/>  Person    <input type=\"radio\" name=\"persontype\" id=\"persontype\" value=\"Business\"/> Business\r\n<h3>Your Info</h3><input name=\"name\"id=\"name\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Name\" required />\r\n<input name=\"email_id\"id=\"email_id\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Email Address\" required />\r\n<input name=\"street_address\"id=\"street_address\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Street Address\" required />\r\n<input name=\"postal_code\"id=\"postal_code\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Postal Code\" required />\r\n<input name=\"dob_date\"id=\"dob_date\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"DOB Day (DD)\" required />\r\n<input name=\"dob_month\"id=\"dob_month\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"DOB Month (MM)\" required />\r\n<input name=\"dob_year\"id=\"dob_year\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"DOB Year (YYYY)\" required />\r\n<input name=\"ssn\"id=\"ssn\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Last 4 of ssn\" required />\r\n<input name=\"phone_number\"id=\"phone_number\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Phone Number\" required />\r\n<h3>Banking Info</h3><input name=\"account_name\" id=\"account_name\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Account holder's name\" required />\r\n<input name=\"account_number\" id=\"account_number\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Account Number\" required />\r\n<input name=\"routing_number\" id=\"routing_number\" type=\"text\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" placeholder=\"Routing Number\" required />\r\n<select name=\"account_type\" id=\"account_type\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\"><option value=\"checking\">checking</option><option value=\"savings\">savings</option></select>\r\n<h3>Terms & conditions / Privacy policy</h3><label><input type=\"checkbox\" name=\"chkterms\" id=\"chkterms\" value=\"y\" data-validate=\"{required:true,messages:{\"required\":\"Required\"}}\" checked=\"checked\"/> I accept the <a href=\"/pages/terms-and-condition\">Terms & Conditions</a> and <a href=\"/pages/privacy-policy\">Privacy Policy</a>.</label>\r\n",
	                    "_fields": {
	                        "name": {
	                            "required": true
	                        },
	                        "email_id": {
	                            "required": true
	                        },
	                        "street_address": {
	                            "required": true
	                        },
	                        "postal_code": {
	                            "required": true
	                        },
	                        "dob_date": {
	                            "required": true
	                        },
	                        "dob_month": {
	                            "required": true
	                        },
	                        "dob_year": {
	                            "required": true
	                        },
	                        "ssn": {
	                            "required": true
	                        },
	                        "phone_number": {
	                            "required": true
	                        },
	                        "account_name": {
	                            "required": true
	                        },
	                        "account_number": {
	                            "required": true
	                        },
	                        "routing_number": {
	                            "required": true
	                        },
	                        "account_type": {
	                            "required": true
	                        },
	                        "chkterms": {
	                            "required": true
	                        }
	                    }
	                }
	            }
	        }
	    ]
	}

Websites Listing

Retrieve the websites list added by merchant.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.

URL

GET api/v1/merchants/{merchant_id}/websites

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites.json

Example Responses

		{
		"websites": [
			{
				"id": "123456",
				"domain_name": "example.com",
				"receiver_count": "0",
				"total_payment_amount": "442.0",
				"total_payment_count": "7"
			}
		]
        }

Vault

To store the card in vault, you have to send the request with the following arguments. ZazPay will give vault_key after add card in vault. Using this vault_key, you can able to call auth or capture to charge the card.

Vault Create

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.

Post Arguments

user_handle
Required User handle.
email
Required Email.
credit_card_number
Required Credit card number.
credit_card_type
Required Credit card valid types are visa, mastercard, discover, amex.
credit_card_expire
Required Credit card expire date.
credit_card_name_on_card
Required Name on credit card.
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "user_handle=123456&credit_card_type=visa&credit_card_expire=YYYY/MM"
email
Required Email.
address
Required Address.
city
Required City.
state
Required State.
country
Required Country.
zip_code
Required Zip Code.
phone
Required Phone.

URL

POST api/v1/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc.json 	-d user_handle=123 	-d email=test@example.com 	-d credit_card_number=4111111111111111 	-d credit_card_expire=10/2016 	-d credit_card_type=visa 	-d credit_card_name_on_card=Fred Barley 	-d email=test@example.com 	-d address=First Street 	-d city=Chennai 	-d state=Tamil Nadu 	-d country=IN 	-d buyer_ip=201.xxx.xx.xx

Example Responses

{
	"id": "123456",
	"user_handle": "xxxxx",
	"credit_card_type": "visa",
	"vault_key": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"masked_cc": "************5678",
	"error": {
		"code": 0,
		"message": []
	}
}

Vault Update

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
vault_id
Required Your ZazPay vault id which was sent on vault create.

Post Arguments

user_handle
Required User handle.
email
Required Email.
credit_card_expire
Required Credit card expire date.
credit_card_name_on_card
Required Name on credit card.
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "user_handle=123456&credit_card_type=visa&credit_card_expire=YYYY/MM"
email
Required Email.
address
Required Address.
city
Required City.
state
Required State.
country
Required Country.
zip_code
Required Zip Code.
phone
Required Phone.

URL

POST api/v1/merchants/{merchant_id}/websites/{website_id}/vaults/{vault_id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/vaults/{vault_id}.json 	-d user_handle=123 	-d email=test@example.com 	-d credit_card_expire=10/2016 	-d credit_card_name_on_card=Fred Barley 	-d email=test@example.com 	-d address=First Street 	-d city=Chennai 	-d state=Tamil Nadu 	-d country=IN 	-d buyer_ip=201.xxx.xx.xx

Example Responses

{
	"id": "123456",
	"user_handle": "xxxxx",
	"credit_card_type": "visa",
	"vault_key": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"masked_cc": "************5678",
	"error": {
		"code": 0,
		"message": []
	}
}

Vault Delete

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
vault_id
Required Your ZazPay vault id which was sent on vault create.

URL

DELETE api/v1/merchants/{merchant_id}/websites/{website_id}/vaults/{vault_id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/vaults/{vault_id}.json

Example Responses

{
	"status": "success",
	"error": {
		"code": 0,
		"message": []
	}
}

Vaults Listing

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
user_handle
Required Reference for the buyer e.g. user_handle of your application.

URL

GET api/v1/merchants/{merchant_id}/websites/{website_id}/vaults

GET api/v1/merchants/{merchant_id}/websites/{website_id}/users/{user_handle}/vaults

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/type/cc
curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/users/{user_handle}/vaults/type/cc.json

Example Responses

 {
 "_metadata":{
      "page": 1,
      "page_count": 1,
      "total_count": 45,
      "Links": [
        {
        	"self": "/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc.json?page=2"
        },
        {
        	"first": "/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc.json?page=1"
        },
        {
        	"previous": "/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc.json?page=1"
        },
        {
        	"next": "/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc.json?page=3"
        },
        {
        	"last": "/merchants/{merchant_id}/websites/{website_id}/vaults/type/cc.json?page=3"
        }
      ]
  },
  "vaults": [
	{
		"id": "26",
		"user_handle": "1",
		"vault_key": "c8a3e590-b913-4adb-8472-3f33f60e8d04",
		"masked_cc": "************4242",
		"credit_card_type": "visa"
	},
	{
		"id": "25",
		"user_handle": "1",
		"vault_key": "3cf543dd-1b6d-4a61-9ac5-afcce5d27d58",
		"masked_cc": "************4242",
		"credit_card_type": "visa"
	}
]
}

PayPal Subscription

PayPal Subscription Create

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.

Post Arguments

user_handle
Required User handle.
item_name
Required The name associated with the payment.
item_description
Required The small description of the payment.
x-variables
Optional These variable names and values are the custom fields of the user. These are returned as the same value during payment completion. Maximum no of variables: 5 e.g., x-user_id = 96722.
z-variables
Optional These are the variables for search filters. Maximum no of variables: 5.
notify_url
Optional The URL to which ZazPay posts information about the payment, in the form of Instant Payment Notification messages.
success_url
Optional The URL to which ZazPay redirect in the case of payment success.
cancel_url
Optional The URL to which ZazPay redirect in the case of payment cancellation.
buyer_email
Required Buyer Email.
buyer_address
Required Buyer Address.
buyer_city
Required Buyer City.
buyer_state
Optional Buyer State.
buyer_country
Required Buyer Country.
buyer_phone
Required Buyer Phone.
buyer_zip_code
Required Buyer Zip Code.
a1
Optional First trial period price. For a free trial period, specify 0.
p1
Required; if a1 specified First trial subscription interval in days, weeks, months or years (example: for one week interval, we need to specify 1")
t1
Required; if a1 specified First trial subscription interval units (D, W, M, Y); (example: for one week interval, we need to specify W")

D - for days; allowable range for p1 is 1 to 90

W - for weeks; allowable range for p1 is 1 to 52

M - for months; allowable range for p1 is 1 to 24

Y - for years; allowable range for p1 is 1 to 5

a2
Optional Second trial period price. Can be specified only if you also specify a1
p2
Required; if a2 specified Second trial subscription interval in days, weeks, months or years (example: for one month interval, we need to specify 1")
t2
Required; if a2 specified Second trial subscription interval units (D, W, M, Y); (example: for one month interval, we need to specify M")

D - for days; allowable range for p2 is 1 to 90

W - for weeks; allowable range for p2 is 1 to 52

M - for months; allowable range for p2 is 1 to 24

Y - for years; allowable range for p2 is 1 to 5

a3
Required Regular subscription price.
p3
Required Subscription interval in days, weeks, months or years (example: for one month interval, we need to specify 1")
t3
Required Subscription interval units (D, W, M, Y); (example: for one month interval, we need to specify M")

D - for days; allowable range for p3 is 1 to 90

W - for weeks; allowable range for p3 is 1 to 52

M - for months; allowable range for p3 is 1 to 24

Y - for years; allowable range for p3 is 1 to 5

currency_code
Required The currency of the payment in ISO format.
fees_payer
Optional Fees payer (buyer / merchant). Default is merchant.
buyer_fees_payer_confirmation_token
Optional You must specify if fees_payer is set as buyer.
buyer_ip
Optional Buyer ip address
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "user_handle=123456&item_name=xxx&item_description=xxxx"

URL

POST api/v1/merchants/{merchant_id}/websites/{website_id}/subscribe/create

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/subscribe/create.json 	-d user_handle=1234 	-d item_name=xxxxxx 	-d item_description=xxxxxxx 	-d notify_url=http://example.com/notify 	-d return_url=http://example.com/return 	-d success_url=http://example.com/success 	-d buyer_email=test@example.com 	-d buyer_address=First Street 	-d buyer_city=Chennai 	-d buyer_state=Tamil Nadu 	-d a1=0 	-d p1=2 	-d t1=M 	-d a3=19 	-d p3=1 	-d t3=M 	-d currency_code=USD 	-d buyer_ip=201.xxx.xx.xx

Example Responses for Step1

{
	"subscription_id":"8536",
	"subcription_status": "Initiated",
	"gateway_callback_url": https://zazpay.com/subscribe/100/52e55860669049878e8189a9b4bcd6d3",
	"error": {
		"code": -4,
		"message": ["Initiated without error"]
	}
}
		

Example Responses for Step2

After authenticate from PayPal

{
	"subscription_id":"8536",
	"subcription_status": "Active",
	"user_handle": xxxx,
	"merchant_id": xxxx,
	"website_id": xxxx,
}
		

Example Response for Subscription Payment

Payment received from PayPal

 
 {
	"id": "8536",
	"subscription_id": "xxxx",
	"user_handle": xxxx,
	"action": "Capture",
	"merchant_id": "xxxx",
	"website_id": "xxxx",
	"amount": "49.99",
	"original_amount": "49.00",
	"currency_code": "USD",
	"status": "Captured",
	"error_code": "0",
	"error_message": "",
	"paykey": "3655020e-5a13-4378-bfb3-731a115xd317",
	"payment_date": " 2015-08-14T18:15:59+05:30",
	"buyer_email": "test@example.com",
	"buyer_address": "First Street",
	"buyer_city": "Chennai",
	"buyer_state": "Tamil Nadu",
	"buyer_country": "IN",
	"buyer_phone": "9999999999",
	"buyer_zip_code": "121",
	"gateway_id": "1",
	"signature": "17cbdae0bd4188933f05ddb0f7ec4ec4",
}

  

PayPal Subscription Cancel

Cancel the PayPal subscription in ZazPay

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
receiver_id
Required Receiver ID got from previous process.

URL

PUT api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/subscribe/{subscription_id}/cancel

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/subscribe/{subscription_id}/cancel.json
			

Example Responses

  {
     "status": "success",
     "subcription_status": "Canceled",
     "error": {
           "code": 0,
           "message": []
      }
    }

Example Response for Subsription Canceled from PayPal

  {
	"subscription_id":"8536",
	"user_handle": xxxx,
	"subcription_status": "Canceled",
	"merchant_id": xxxx,
	"website_id": xxxx
    }

PayPal Subscription Details

Retrieve details about a PayPal Subscription. Pass the unique Subscription ID that was returned from your previous request.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
subscription_id
Required Your ZazPay PayPal Subscription ID

URL

GET api/v1/merchants/{merchant_id}/subscribe/{subscription_id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/subscribe/{subscription_id}.json

Example Responses

	{
	    "subscription_id": 210,
	    "created": "2015-08-21T12:38:14+05:30",
	    "user_handle": "100",
	    "status": "Active",
	    "item_name": "Monthly subscription fee",
	    "item_description": "Monthly subscription fee",
	    "fees_payer": "BUYER",
	    "merchant": {
		"id": 2,
		"name": "Fred Barley"
	    },
	    "website": {
		"id": 2,
		"name": "example.com"
	    },
	    "buyer": {
		"email": "test@example.com",
		"address": "First Street",
		"city": "Chennai",
		"state": "Tamil Nadu",
		"country": "IN"
	    },
	    "ipn": {
		"count": 20,
		"latest_delivery_attempt_date": "2015-08-21T15:02:40+05:30",
		"latest_delivery_attempt_status": "Sent"
	    },
	    "x-vars": {},
	    "z-vars": {
		"z-username": "james",
		"z-category": "Dress"
	    },
	    "error": {
		"code": 0,
		"message": []
	    },
	    "payments": [
		{
		    "id": 22510,
		    "created": "2015-08-21T14:59:23+05:30",
		    "modified": "2015-08-21T14:59:24+05:30",
		    "amount": 1.46,
		    "original_amount": 1.00,
		    "status": "Captured",
		    "paykey": "4b6ef5d1-a547-40af-873b-4fcd404b8xb7",
		    "item_name": "Monthly subscription fee",
		    "item_description": "Monthly subscription fee",
		    "action": "Capture",
		    "fees_payer": "BUYER",
		    "website": {
			"id": 2,
			"name": "example.com"
		    },
		    "buyer": {
			"email": "test@example.com",
			"address": "First Street",
			"city": "Chennai",
			"state": "Tamil Nadu",
			"country": "IN"
		    },
		    "ipn": {
			"count": 1,
			"latest_delivery_attempt_date": "2015-08-21T14:59:24+05:30",
			"latest_delivery_attempt_status": "Sent"
		    },
		    "error": {
			"code": 0,
			"message": []
		    }
		},
		{
		    "id": 22513,
		    "created": "2015-08-21T15:10:23+05:30",
		    "modified": "2015-08-21T15:10:24+05:30",
		    "amount": 1.46,
		    "original_amount": 1.00,
		    "status": "Pending",
		    "pending_reason": "multi_currency",
		    "item_name": "Monthly subscription fee",
		    "item_description": "Monthly subscription fee",
		    "action": "Capture",
		    "fees_payer": "BUYER",
		    "merchant": {
			"id": 2,
			"name": "Fred Barley"
		    },
		    "website": {
			"id": 2,
			"name": "example.com"
		    },
		    "buyer": {
			"email": "test@example.com",
			"address": "First Street",
			"city": "Chennai",
			"state": "Tamil Nadu",
			"country": "IN"
		    },
		    "ipn": {
			"count": 0,
			"latest_delivery_attempt_date": "",
			"latest_delivery_attempt_status": ""
		    },
		    "error": {
			"code": -8,
			"message": [
			    "Payment pending"
			]
		    }
		},
		{
		    "id": 22508,
		    "created": "2015-08-21T13:46:07+05:30",
		    "modified": "2015-08-21T19:55:40+05:30",
		    "amount": 1.46,
		    "original_amount": 1.00,
		    "status": "Error",
		    "item_name": "Monthly subscription fee",
		    "item_description": "Monthly subscription fee",
		    "action": "Capture",
		    "fees_payer": "BUYER",
		    "merchant": {
			"id": 2,
			"name": "Fred Barley"
		    },
		    "website": {
			"id": 2,
			"name": "example.com"
		    },
		    "buyer": {
			"email": "test@example.com",
			"address": "First Street",
			"city": "Chennai",
			"state": "Tamil Nadu",
			"country": "IN"
		    },
		    "ipn": {
			"count": 5,
			"latest_delivery_attempt_date": "2015-08-21T19:55:40+05:30",
			"latest_delivery_attempt_status": "Sent"
		    },
		    "error": {
			"code": 281474976710656,
			"message": [
			    "Subscription Payment Failed"
			]
		    }
		}
	    ]
	}


Receiver Account

Receiver Account Create

Create receiver accounts in ZazPay.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
receiver_id
Required Receiver ID got from previous process.

Post Arguments

name
Required Receiver name.
email
Required Receiver email address.
notify_url
Required The URL to which ZazPay posts information about the account creation, in the form of Instant Payment Notification messages.
return_url
Required The URL to which ZazPay redirect in the case of account creation success.

URL

POST api/v1/merchants/{merchant_id}/websites/{merchant_id}/gateways/{gateway_id}/receiver_accounts

POST api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/receiver_accounts/{receiver id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/receiver_accounts.json 	-d notify_url=http://example.com/notify 	-d return_url=http://example.com/return

Example Responses for step1

   	{
		"websites": {
			"id": "232",
			"name": "example.com"
		},
		"gateways": [
			{
				"id": 1,
				"name": "Paypal Adaptive",
				"gateway_callback_url": "http://sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=xxxxxxx-xxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxx&response_type=code&scope=openid&redirect_uri=http://example.com/notify_test.php"
			},
			{
				"id": 2,
				"name": "Authorize.net",
				"gateway_callback_url": "http://www.authorize.net/webscr?cmd=_ap-preapproval&preapprovalkey=PA-4NG569049M379034U"
			}
		],
		"error": {
			"code": 0,
			"message": []
		}
	}


		  		 

Example Responses for step2

{
	"id": 12434,
	"websites": {
		"id": "232",
		"name": "agriya.com"
	},
	"gateways": [
		{
			"id": 1,
			"name": "PaypalAdaptive"
		},
		{
			"id": 2,
			"name": "Authorize.net"
		}
	],
	"error": {
		"code": 0,
		"message": []
	}
}

Receiver Account Delete

Delete the connected receiver account in ZazPay

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
receiver_id
Required Receiver ID got from previous process.

URL

DELETE api/v1/merchants/{merchant_id}/websites/{website_id}/receiver_accounts/{receiver_id}

DELETE api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/receiver_accounts/{receiver_id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/receiver_accounts/{receiver id}.json 	-x DELETE
												

Example Responses

  {
     "status": "success",
     "error": {
           "code": 0,
           "message": []
      }
    }

Receiver Accounts Listing

Retrieve the receiver accounts list connected by receiver.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Required You can get it from websites listing page.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
receiver_id
Required Receiver ID got from previous process.

URL

GET api/v1/merchants/{merchant_id}/websites/{website_id}/receiver_accounts/{receiver id}

GET api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/receiver_accounts/{receiver id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/websites/{website_id}/gateways/{gateway_id}/receiver_accounts/{receiver id}.json

Example Responses

  	{
		"_metadata": {
			"page": 5,
			"page_count": 20,
			"total_count": 521,
			"Links": [
				{
					"self": "/merchants/{merchant_id}/gateways/{gateway_id}/receiver_accounts?page=5"
				},
				{
					"first": "/merchants/{merchant_id}/gateways/{gateway_id}/receiver_accounts?page=1"
				},
				{
					"previous": "/merchants/{merchant_id}/gateways/{gateway_id}/receiver_accounts?page=4"
				},
				{
					"next": "/merchants/{merchant_id}/gateways/{gateway_id}/receiver_accounts?page=6"
				},
				{
					"last": "/merchants/{merchant_id}/gateways/{gateway_id}/receiver_accounts?page=26"
				}
			]
		},
		"id": 12434,
		"websites": {
			"id": "123456",
			"name": "example.com"
		},
		"gateways": [
			{
				"id": 1,
				"name": "PaypalAdaptive"
			},
			{
				"id": 2,
				"name": "Authorize.net"
			}
		],
		"error": {
			"code": 0,
			"message": []
		}
	}


Action Terminology Overview

Simple Payments

Auth
When authorize, amount will not move from buyer account.
Auth-Capture
Capture an authorized payment but not yet voided. Amount will move from buyer to merchant.
Void
Void previously authorized payment but not yet captured.
Capture
When capture, amount will move from buyer to merchant.
Refund
Refund a captured captured payment but not yet refunded.
[Image: Payment Flow]

Marketplace Payments

Marketplace-Auth
When authorize, amount will not move from buyer account.
Marketplace-Auth-Capture
Capture an authorized payment but not yet voided. Amount will move from buyer to receiver & merchant.
Marketplace-Void
Void previously authorized payment but not yet captured.
Marketplace-Capture
When capture, amount will move from buyer to receiver & merchant.
Marketplace-Refund
Refund a captured captured payment but not yet refunded.
[Image: Marketplace Payment Flow]

Auth

Authorizes amount to be captured later. Can Auth-Capture or Void.

Offsite Gateways means buyer will be redirect to gateway site to make payment. So ZazPay will return "gateway_callback_url" in the response.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be auth.

Post Arguments

website_id
Required You can get it from websites listing page.
amount
Required The price or amount associated with the transaction.
currency_code
Required The currency of the payment in ISO format.
item_name
Required The name associated with the payment.
item_description
Required The small description of the payment.
x-variables
Optional These variable names and values are the custom fields of the user. These are returned as the same value during payment completion. Maximum no of variables: 5 e.g., x-user_id = 96722.
z-variables
Optional These are the variables for search filters. Maximum no of variables: 5.
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "currency_code=USD&item_name=purchase&amount=10.00"
notify_url
Optional The URL to which ZazPay posts information about the payment, in the form of Instant Payment Notification messages.
success_url
Optional The URL to which ZazPay redirect in the case of payment success.
cancel_url
Optional The URL to which ZazPay redirect in the case of payment cancellation.
buyer_email
Required Buyer Email.
buyer_address
Required Buyer Address.
buyer_city
Required Buyer City.
buyer_state
Optional Buyer State.
buyer_country
Required Buyer Country.
buyer_phone
Required Buyer Phone.
buyer_zip_code
Required Buyer Zip Code.
fees_payer
Optional Fees payer (buyer / merchant). Default is merchant.
buyer_fees_payer_confirmation_token
Optional You must specify if fees_payer is set as buyer.

Gateway Related Arguments

credit_card_number
Optional Credit card number.
credit_card_expire
Optional Credit card expire date.
credit_card_name_on_card
Optional Name on credit card.
credit_card_code
Optional CVV2 code on credit card.

( OR )

vault_key
Optional Your ZazPay vault_key which was sent on vault create.

( OR )

payment_note
Required Buyer can give a note about his payment like cheque number, bank transaction number etc.,

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/auth

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/auth.json 	-d website_id={website_id} 	-d currency_code=USD 	-d amount=100 	-d item_name=Charge for test@example.com 	-d item_description=Charge for test@example.com 	-d buyer_ip=201.xxx.xx.xx 	-d buyer_email=test@example.com 	-d buyer_address=First Street 	-d buyer_city=Chennai 	-d buyer_state=Tamil Nadu 	-d buyer_country=IN

Example Responses for Direct Gateways

   {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Authorized",
	"paykey": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"error": {
		"code": 0,
		"message": []
	}
}

Example Responses for Offsite Gateways

{
	"id":"8536",
	"status": "Initiated",
	"gateway_callback_url": "https://www.example.com/payment/checkout/52e55860-6690-4987-8e81-89a9b4bcd6d3",
	"error": {
		"code": -4,
		"message": ["Initiated without error"]
	}
}

Auth-Capture

Most credit card payment gateways provide Auth-Capture, by which the payments can be authorized first and then captured after certain time. But, it may not be suitable for long duration. So, here vault is the only option to capture money after long time. ZazPay automatically handles vault for all Auth-Capture.

While call Auth-Capture, ZazPay will try to auth-capture the authorized payment using the authorization token. If the authorization token was expired then ZazPay will get the card details from vault and capture the card. After successfully captured, ZazPay will delete the card from vault.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be auth-capture.
payment_id
Required Your ZazPay Payment ID which was sent on authorize.

Post Arguments

paykey
Required Your ZazPay paykey which was sent on authorize.

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/auth-capture

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/auth-capture.json 	-d paykey=77414af7-6e7b-46cd-9440-a88b65c082f6

Example Responses

    {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Captured",
	"paykey": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"error": {
		"code": 0,
		"message": []
	}
}

	

Void

Cancels authorized amount.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be void.
payment_id
Required Your ZazPay Payment ID which was sent on authorize.

Post Arguments

paykey
Required Your ZazPay paykey which was sent on authorize.

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/void

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/void.json 	-d paykey=77414af7-6e7b-46cd-9440-a88b65c082f6

Example Responses

 {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Voided",
	"error": {
		"code": 0,
		"message": []
	}
}

   

Capture

Captures amount immediately. Can Refund to reverse settlement.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be capture.

Post Arguments

website_id
Required You can get it from websites listing page.
amount
Required The price or amount associated with the transaction.
currency_code
Required The currency of the payment in ISO format.
item_name
Required The name associated with the payment.
item_description
Required The small description of the payment.
x-variables
Optional These variable names and values are the custom fields of the user. These are returned as the same value during payment completion. Maximum no of variables: 5 e.g., x-user_id = 96722.
z-variables
Optional These are the variables for search filters. Maximum no of variables: 5.
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "currency_code=USD&item_name=purchase&amount=10.00"
notify_url
Optional The URL to which ZazPay posts information about the payment, in the form of Instant Payment Notification messages.
success_url
Optional The URL to which ZazPay redirect in the case of payment success.
cancel_url
Optional The URL to which ZazPay redirect in the case of payment cancellation.
buyer_email
Required Buyer Email.
buyer_address
Required Buyer Address.
buyer_city
Required Buyer City
buyer_state
Optional Buyer State.
buyer_country
Required Buyer Country.
buyer_phone
Required Buyer Phone.
buyer_zip_code
Required Buyer Zip Code.
fees_payer
Optional Fees payer (buyer / merchant). Default is merchant.
buyer_fees_payer_confirmation_token
Optional You must specify if fees_payer is set as buyer.

Gateway Related Arguments

credit_card_number
Optional Credit card number.
credit_card_expire
Optional Credit card expire date.
credit_card_name_on_card
Optional Name on credit card.
credit_card_code
Optional CVV2 code on credit card.

( OR )

vault_key
Optional Your ZazPay vault_key which was sent on vault create.

( OR )

payment_note
Required Buyer can give a note about his payment like cheque number, bank transaction number etc.,

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/capture

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/capture.json 	-d website_id={website_id} 	-d currency_code=USD 	-d amount=100 	-d item_name=Charge for test@example.com 	-d item_description=Charge for test@example.com 	-d buyer_ip=201.xxx.xx.xx 	-d buyer_email=test@example.com 	-d buyer_address=First Street 	-d buyer_state=Chennai 	-d buyer_state=Tamil Nadu 	-d buyer_country=IN"

Example Responses for Direct Gateways

    {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Captured",
	"paykey": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"error": {
		"code": 0,
		"message": []
	}
}

  

Example Responses for Offsite Gateways

{
	"id":"8536",
	"status": "Initiated",
	"gateway_callback_url": "https://www.example.com/payment/checkout/52e55860-6690-4987-8e81-89a9b4bcd6d3",
	"error": {
		"code": -4,
		"message": ["Initiated without error"]
	}
}
											

Refund

Refunds captured amount completely (100% reversal).

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be refund.
payment_id
Required Your ZazPay Payment ID which was sent on capture.

Post Arguments

paykey
Required Your ZazPay paykey which was sent on capture.

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/refund

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payemnt id}/refund.json 	-d paykey=77414af7-6e7b-46cd-9440-a88b65c082f6

Example Responses

     {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Refunded",
	"error": {
		"code": 0,
		"message": []
	}
}

	

Marketplace-Auth

Authorizes buyer's amount to be captured later. Can Marketplace-Auth-Capture or Marketplace-Void.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be marketplace-auth.

Post Arguments

website_id
Required You can get it from websites listing page.
amount
Required The price or amount associated with the transaction.
currency_code
Required The currency of the payment in ISO format.
item_name
Required The name associated with the payment.
item_description
Required The small description of the payment.
marketplace_receiver_id
Required ZazPay receiver ID got it from receiver accounts API requests.
marketplace_receiver_amount
Required The price or amount associated with the receiver.
marketplace_fixed_merchant_amount
Required if marketplace_variable_merchant_amount is not passed The price or amount associated with the merchant.
marketplace_variable_merchant_amount
Required if marketplace_fixed_merchant_amount is not passed The percentage of price or amount associated with the merchant.
marketplace_fees_payer
Optional Fees payer (buyer / receiver / merchant). Default is receiver.
x-variables
Optional These variable names and values are the custom fields of the user. These are returned as the same value during payment completion. Maximum no of variables: 5 e.g., x-user_id = 96722.
z-variables
Optional These are the variables for search filters. Maximum no of variables: 5.
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "currency_code=USD&item_name=purchase&amount=10.00"
notify_url
Optional The URL to which ZazPay posts information about the payment, in the form of Instant Payment Notification messages.
success_url
Optional The URL to which ZazPay redirect in the case of payment success.
cancel_url
Optional The URL to which ZazPay redirect in the case of payment cancellation.
buyer_email
Required Buyer Email.
buyer_address
Required Buyer Address.
buyer_city
Required Buyer City.
buyer_state
Optional Buyer State.
buyer_country
Required Buyer Country.
buyer_phone
Required Buyer Phone.
buyer_zip_code
Required Buyer Zip Code.

Gateway Related Arguments

credit_card_number
Optional Credit card number.
credit_card_expire
Optional Credit card expire date.
credit_card_name_on_card
Optional Name on credit card.
credit_card_code
Optional CVV2 code on credit card.

( OR )

vault_key
Optional Your ZazPay vault_key which was sent on vault create.

( OR )

payment_note
Required Buyer can give a note about his payment like cheque number, bank transaction number etc.,

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/marketplace-auth

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/marketplace-auth.json 	-d website_id={website_id} 	-d currency=USD 	-d amount=100 	-d item_name=Charge for test@example.com 	-d item_description=Charge for test@example.com 	-d buyer_ip=201.xxx.xx.xx 	-d buyer_email=test@example.com 	-d buyer_address=First Street 	-d buyer_city=Chennai 	-d buyer_state=Tamil Nadu 	-d buyer_country=IN 	-d marketplace_receiver_id=123 	-d marketplace_receiver_amount=50 	-d marketplace_fixed_merchant_amount=50 	-d marketplace_fees_payer=receiver

Example Responses for Direct Gateways

 {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Authorized",
	"paykey": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"receiver": {
		"id": "2323",
		"amount": "19"
	},
	"marketplace_fees_payer": "receiver",
	"marketplace_fixed_merchant_amount": 12,
	"marketplace_variable_merchant_amount": "",
	"error": {
		"code": 0,
		"message": []
	}
}

Example Responses for Offsite Gateways

{
	"id":"8536",
	"status": "Initiated",
	"gateway_callback_url": "https://www.example.com/payment/checkout/52e55860-6690-4987-8e81-89a9b4bcd6d3",
	"error": {
		"code": -4,
		"message": ["Initiated without error"]
	}
}
										

Marketplace-Auth-Capture

Captures authorized amount. Buyer's amount goes to merchant and receiver (seller or service provider in website). Can Marketplace-Refund to reverse settlement.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be marketplace-auth-capture.
payment_id
Required Your ZazPay Payment ID which was sent on authorize.

Post Arguments

paykey
Required Your ZazPay paykey which was sent on authorize.

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/marketplace-auth-capture

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/marketplace-auth-capture.json 	-d paykey=77414af7-6e7b-46cd-9440-a88b65c082f6

Example Responses

    {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Captured",
	"paykey": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"receiver": {
		"id": "2323",
		"amount": "19"
	},
	"marketplace_fees_payer": "receiver",
	"marketplace_fixed_merchant_amount": 12,
	"marketplace_variable_merchant_amount": "",
	"error": {
		"code": 0,
		"message": []
	}
}

   

Marketplace-Void

Cancels authorized amount.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be marketplace-void.
payment_id
Required Your ZazPay Payment ID which was sent on authorize.

Post Arguments

paykey
Required Your ZazPay paykey which was sent on authorize.

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/marketplace-void

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/marketplace-void.json 	-d paykey=77414af7-6e7b-46cd-9440-a88b65c082f6

Example Responses

     {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Voided",
	"error": {
		"code": 0,
		"message": []
	}
}

	

Marketplace-Capture

Captures amount immediately. Buyer's amount goes to merchant and receiver (seller or service provider in website). Can Marketplace-Refund to reverse settlement.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be marketplace-capture.

Post Arguments

website_id
Required You can get it from websites listing page.
amount
Required The price or amount associated with the transaction.
currency_code
Required The currency of the payment in ISO format.
item_name
Required The name associated with the payment.
item_description
Required The small description of the payment.
marketplace_receiver_id
Required ZazPay receiver ID got it from receiver accounts API requests.
marketplace_receiver_amount
Required The price or amount associated with the receiver.
marketplace_fixed_merchant_amount
Required if marketplace_variable_merchant_amount is not passed The price or amount associated with the merchant.
marketplace_variable_merchant_amount
Required if marketplace_fixed_merchant_amount is not passed The percentage of price or amount associated with the merchant.
marketplace_fees_payer
Optional Fees payer (buyer / receiver / merchant). Default is receiver.
x-variables
Optional These variable names and values are the custom fields of the user. These are returned as the same value during payment completion. Maximum no of variables: 5 e.g., x-user_id = 96722.
z-variables
Optional These are the variables for search filters. Maximum no of variables: 5.
signature
Optional To avoid form tampering. Formula to get signature: md5(secret_string + form_fields). secret_string: You can get it from ZazPay dashboard. form_fields: Concatenate all the form fields like this except signature. e.g., "currency_code=USD&item_name=purchase&amount=10.00"
notify_url
Optional The URL to which ZazPay posts information about the payment, in the form of Instant Payment Notification messages.
success_url
Optional The URL to which ZazPay redirect in the case of payment success.
cancel_url
Optional The URL to which ZazPay redirect in the case of payment cancellation.
buyer_email
Required Buyer Email.
buyer_address
Required Buyer Address.
buyer_city
Required Buyer City
buyer_state
Optional Buyer State.
buyer_country
Required Buyer Country.
buyer_phone
Required Buyer Phone.
buyer_zip_code
Required Buyer Zip Code.

Gateway Related Arguments

credit_card_number
Optional Credit card number.
credit_card_expire
Optional Credit card expire date.
credit_card_name_on_card
Optional Name on credit card.
credit_card_code
Optional CVV2 code on credit card.

( OR )

vault_key
Optional Your ZazPay vault_key which was sent on vault create.

( OR )

payment_note
Required Buyer can give a note about his payment like cheque number, bank transaction number etc.,

URL

POST /v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/marketplace-capture

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/marketplace-capture.json 	-d website_id={website_id} 	-d currency=USD 	-d amount=100 	-d item_name=Charge for test@example.com 	-d item_description=Charge for test@example.com 	-d buyer_ip=201.xxx.xx.xx 	-d buyer_email=test@example.com 	-d buyer_address=First Street 	-d buyer_city=Chennai 	-d buyer_state=Tamil Nadu 	-d buyer_country=IN 	-d marketplace_receiver_id=1234 	-d marketplace_receiver_amount=50 	-d marketplace_fixed_merchant_amount=50 	-d marketplace_fees_payer=receiver

Example Responses for Direct Gateways

   {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Captured",
	"paykey": "53b1d221-532c-428d-aaf1-0ece3aea7021",
	"receiver": {
		"id": "2323",
		"amount": "19"
	},
	"marketplace_fees_payer": "receiver",
	"marketplace_fixed_merchant_amount": 12,
	"marketplace_variable_merchant_amount": "",
	"error": {
		"code": 0,
		"message": []
	}
}

Example Responses for Offsite Gateways

{
	"id":"8536",
	"status": "Initiated",
	"gateway_callback_url": "https://www.example.com/payment/checkout/52e55860-6690-4987-8e81-89a9b4bcd6d3",
	"error": {
		"code": -4,
		"message": ["Initiated without error"]
	}
}

Marketplace-Refund

Refunds captured amount completely (100% reversal).

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
gateway_id
Required Gateway ID provided by ZazPay in gateways listing API request.
action
Required It must be marketplace-refund.
payment_id
Required Your ZazPay Payment ID which was sent on capture.

Post Arguments

paykey
Required Your ZazPay paykey which was sent on capture.

URL

POST api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/marketplace-refund

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payments/{payment_id}/marketplace-refund.json 	-d paykey=77414af7-6e7b-46cd-9440-a88b65c082f6

Example Responses

   	 {
	"id": "8536",
	"created": "2013-07-06T16:36:39+05:30",
	"modified": "2013-07-06T16:43:11+05:30",
	"status": "Refunded",
	"refunded_from": [
		  {
			"marketplace_receiver_id": "2323",
			"amount": "19" 
		  },
		  {
			"marketplace_merchant_id": "2323",
			"amount": "19" 
		  }	
	],
	"error": {
		"code": 0,
		"message": []
	}
}

	

Payment Details

Retrieve details about a payment. Pass the unique payment ID that was returned from your previous request.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
payment_id
Required Your ZazPay Payment ID

URL

GET api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payment/{payment_id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/gateways/{gateway_id}/payment/{payment_id}.json

Example Responses

   	{
		"id": 8517,
		"created": "2013-07-06T12:17:28+05:30",
		"modified": "2013-07-06T13:38:04+05:30",
		"amount": 100,
		"status": "Captured",
		"paykey": "5fed2864-1a1f-49a8-ace9-1fbe077d8e27",
		"item_name": "Signup Fee",
		"item_description": "Signup Fee",
		"action": "Void",
		"merchant": {
			"id": "2",
			"name": "Fred Barley"
		},
		"gateway": {
			"id": "2",
			"name": "Authorize.net"
		},
		"website": {
			"id": {website_id},
			"name": "example.com"
		},
		"payment_histories": [
			{
				"created": "2013-07-06T12:29:20+05:30",
				"action": "Auth",
				"status": "Authorized"
			},
			{
				"created": "2013-07-06T12:29:20+05:30",
				"action": "Auth-Capture",
				"status": "Captured"
			}
		],
		"buyer": {
			"email": "test@example.com",
			"address": "First Street",
			"city": "Chennai",
			"state": "Tamil Nadu",
			"country": "IN"
		},
		"marketplace": {
			"receiver_id": "11",
			"receiver_amount": "435",
			"fees_payer": "receiver",
			"fixed_merchant_amount": "45",
			"variable_merchant_amount": ""
		},
		"ipn": {
			"count": 2,
			"latest_delivery_attempt_date": "2013-07-06T13:38:04+05:30",
			"latest_delivery_attempt_status": "Sent"
		},
		"x-vars": {},
		"z-vars": {
			"z-username": "james",
			"z-category": "Dress",
			"z-city": "Chennai"
		},
		"error": {
			"code": 0,
			"message": []
		}
	}

	

Payments Listing

Retrieve the payment lists for a particular Merchant/Website.

URL Arguments

merchant_id
Required Your ZazPay ID. You can get it from the dashboard page of your merchant account.
website_id
Optional You can get it from websites listing page.

URL

GET api/v1/merchants/{merchant_id}/payments

GET api/v1/merchants/{merchant_id}/payments?website_id={website_id}

Example Requests

curl https://zazpay.com/api/v1/merchants/{merchant_id}/payments.json

Example Responses

    	{
		"_metadata": {
			"page": 5,
			"page_count": 20,
			"total_count": 521,
			"Links": [
				{
					"self": "/merchants/123/payments?page=5"
				},
				{
					"first": "/merchants/123/payments?page=1"
				},
				{
					"previous": "/merchants/123/payments?page=4"
				},
				{
					"next": "/merchants/123/payments?page=6"

				},
				{
					"last": "/merchants/123/payments?page=26"
				}
			]
		},
		"payments": [
			{
				"id": 8517,
			    "created": "2013-07-06T12:17:28+05:30",
				"modified": "2013-07-06T13:38:04+05:30",
				"amount": 100,
				"status": "Canceled",
				"item_name": "Signup Fee",
				"item_description": "Signup Fee",
				"action": "void",
				"merchant": {
					"id": "2",
					"name": "Fred Barley"
				},
				"gateway": {
					"id": "2",
					"name": "Authorize.net"
				},
				"website": {
					"id": "123456",
					"name": "example.com"
				},
				"payment_histories": [
					{
						"created": "2013-07-06T12:29:20+05:30",
						"action": "Auth",
						"status": "Authorized"
					},
					{
						"created": "2013-07-06T12:29:20+05:30",
						"action": "Void",
						"status": "Voided"
					}
				],
				"buyer": {
					"email": "test@example.com",
					"address": "First Street",
					"city": "Chennai",
					"state": "Tamil Nadu",
					"country": "IN"
				},
				"ipn": {
					"count": 2,
					"latest_delivery_attempt_date": "2013-07-06T13:38:04+05:30",
					"latest_delivery_attempt_status": "Sent"
				},
			"marketplace": {
			"receiver_id": "11",
			"receiver_amount": "435",
			"fees_payer": "receiver",
			"fixed_merchant_amount": "45",
			"variable_merchant_amount": ""
			},
				"x-vars": {},
				"z-vars": {
					"z-username": "james ",
					"z-category": "Dress ",
					"z-city": "Chennai "
				},
				"error": {
					"code": 0,
					"message": []
				}
			}
		]
	}

	

Error Codes

In ZazPay, we will send error code and messages if the payment is an error.

Error Messages in Payments

Bit Position
Description
1
Merchant ID is missing.
2
Website ID is missing.
3
Amount is missing.
4
Currency is missing.
5
Action is missing.
6
Item name is missing.
7
Item description is missing.
8
Posted invalid Merchant ID.
9
Posted invalid Website ID.
10
Website ID and Merchant ID is mismatching.
11
Posted invalid amount.
12
Posted invalid currency.
13
Posted invalid action.
14
Posted invalid signature.
15
Posted cancel URL is mismatch with posted Website ID.
16
Posted success URL is mismatch with posted Website ID.
17
Posted notify URL is mismatch with posted Website ID.
18
Posted gateway preference is invalid.
19
The current plan is inactive.
20
The payment is already processed.
21
Validation failed. The fields required for chosen gateway is not passed as mentiond in Gateway Listing API
22
Merhant is not enable gateway in ZazPay.
23
Posted Gateway ID is invalid.
24
Gateway Error.
25
Buyer canceled payment.
26
X-Vars Limit is exceeded. You can pass 5 x-vars.
27
Z-Vars Limit is exceeded. You can pass 5 z-vars.
28
Posted action is not support by the posted gateway.
29
Missing marketplace receiver ID.
30
Missing marketplace receiver amount.
31
Invalid receiver ID.
32
Invalid receiver amount.
33
Invalid merchant amount.
34
Invalid marketplace amount.
35
Gateway is soft disabled currently.
36
The plan is not support API calling.
37
Posted capture limit is not valid.
38
Posted capture days is not comfortable with gateway capture days.
39
Missing success URL.
40
Missing cancel URL.
41
Invalid user input.
42
Invalid language.
43
Language is mismatching.
44
Invalid buyer confirmation token.
45
Invalid ISO2 country code.
46
The fields required for chosen gateway is either card details or vault key.
47
Posted invalid Vault Key.

Error Messages in Receivers

Bit Position
Description
1
Missing receiver name.
2
Missing receiver email.
3
Missing notify URL.
4
Missing return URL.
5
Invalid Website.
6
Mismatch Notify URL.
7
Mismatch Return URL.
8
Validation Failed.
9
Gateway Error.
10
Canceled by User.

Error Messages in Vault

Bit Position
Description
1
Merchant ID is missing.
2
Website ID is missing.
3
Posted invalid Merchant ID.
4
Posted invalid Website ID.
5
Website ID and Merchant ID is mismatching.
6
Posted invalid signature.
7
Validation failed. Required fields missing.
8
Invalid ISO2 country code.
9
Posted invalid Vault ID.

Error Messages in PayPal Subscription

Bit Position
Description
1
Missing Website ID.
2
Missing Buyer Email.
3
Missing Buyer City.
4
Missing Buyer Country.
5
Missing Buyer Phone Number.
6
Missing Buyer Zip Code.
7
Missing a3 Value.
8
Missing p3 Value.
9
Missing t3 Value.
10
Missing Item Name.
11
Missing Item Description.
12
Missing Success URL.
13
Missing Cancel URL.
14
Missing Notify URL.
15
Validation Failed.
16
Posted cancel URL is mismatch with posted Website ID.
17
Posted success URL is mismatch with posted Website ID.
18
Posted notify URL is mismatch with posted Website ID.
19
Posted invalid signature.
20
Posted invalid a3.
21
Posted invalid p3.
22
Posted invalid t3.
23
Posted invalid a2.
24
Missing p2 Value.
25
Posted invalid p2.
26
Missing t2 Value.
27
Posted invalid t2.
28
Posted invalid a1.
29
Missing p1 Value.
30
Posted invalid p1.
31
Missing t1 Value.
32
Posted invalid t1.
33
X-Vars Limit is exceeded. You can pass 5 x-vars.
34
Z-Vars Limit is exceeded. You can pass 5 z-vars
35
Missing Merchant ID.
36
Posted invalid Merchant ID.
37
Posted invalid Website ID.
38
Currency is missing.
39
Posted invalid currency.
40
Website ID and Merchant ID is mismatching.
41
The current plan is inactive.
42
Invalid ISO2 country code.
43
Missing buyer confirmation token.
44
Invalid buyer confirmation token.
45
Invalid Subscription ID.
46
Missing Buyer Address.
47
Gateway Error
48
Missing a1. a2 can be specified only if specify a1.
49
Canceled by user.
50
Merchant is not enable gateway in ZazPay.

Error Messages in Payment Details

Bit Position
Description
1
Permission Denied.
2
Mismatch of Plan for API. Your current plan is not support for API calling.

Error Messages in Payments Listing

Bit Position
Description
1
Mismatch of Plan for API. Your current plan is not support for API calling.

Error Messages in Gateways Listing

Bit Position
Description
1
Mismatch of Plan for API. Your current plan is not support for API calling.

Error Messages in Receiver Account Listing

Bit Position
Description
1
Mismatch of Plan for API. Your current plan is not support for API calling.

Error Messages in Create Receiver Account

Bit Position
Description
1
Missing Name.
2
Missing Email.
3
Missing Notify URL.
4
Missing return URL.
5
Invalid Website.
6
Mismatch Notify URL.
7
Mismatch Return URL.
8
Validation Failed.
9
Gateway Error.
10
Canceled by User.

Error Messages in Websites Listing

Bit Position
Description
1
Mismatch of Plan for API. Your current plan is not support for API calling.