{
	"info": {
		"_postman_id": "4ae8dafa-d999-4e9c-b385-45b290d8d61f",
		"name": "Gate-E API",
		"description": "Postman collection for Gate-E API calls",
		"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
		"_exporter_id": "28768141"
	},
	"item": [
		{
			"name": "Module 2: Initiate Payment",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "multipart/form-data"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "unique_id",
							"value": "{{unique_id}}",
							"description": "The unique ID of the company, you can get it\nfrom API Settings.",
							"type": "text"
						},
						{
							"key": "amount",
							"value": "1.5",
							"description": "Set the required amount of the payment.",
							"type": "text"
						},
						{
							"key": "api_type",
							"value": "2",
							"description": "If there is no value, the system will select\ndefault API type:\n1. Use API through customer registration\n(value: 1 - default)\n2. Use API without customer registration\n(value: 2)\n3. Use API through customer registration\n& customer information only\n(value: 3)\n4. Use API though customer login only\n(value: 4)",
							"type": "text"
						},
						{
							"key": "tax_rate",
							"value": "5",
							"description": "Set the tax rate for the payment.",
							"type": "text"
						},
						{
							"key": "tax_amount",
							"value": "0.075",
							"description": "Set the tax amount for the payment.\n- Take higher priority when provided with\ntax_rate, tax_rate will be ignored if both\nprovided.",
							"type": "text"
						},
						{
							"key": "tax_country_include",
							"value": "US,CA",
							"description": "Set tax applicable countries.\n- Country codes separated by comma “,”\n- Default is “all”, to apply to all customers.",
							"type": "text"
						},
						{
							"key": "tax_country_exclude",
							"value": "FR",
							"description": "Set which countries are to be excluded from\nTax\n- Country codes separated by comma “,”",
							"type": "text"
						},
						{
							"key": "ref_code",
							"value": "REF12345",
							"description": "Transaction reference code.",
							"type": "text"
						},
						{
							"key": "currency_code",
							"value": "USD",
							"description": "Currency code in which the payment will be\npresented and converted.\n- Note that the final payment will be in\nyour Gate-E account currency.\n- Required with currency rate.",
							"type": "text"
						},
						{
							"key": "currency_rate",
							"value": "1.0",
							"description": "Currency rate to convert to Gate-E account\ncurrency.\n- Note that the final payment amount will\nbe converted using this currency rate\ninstead of Gate-E standard rates.\n- Required with currency code.",
							"type": "text"
						},
						{
							"key": "customer_tax_tin",
							"value": "TIN123456",
							"description": "Set the customer tax registration number.",
							"type": "text"
						},
						{
							"key": "description",
							"value": "Payment for order #12345",
							"description": "Set your custom description of the payment.",
							"type": "text"
						},
						{
							"key": "action",
							"value": "background",
							"description": "How to process payment data:\n1. Process payment data normally (value:\nnormal - default)\n2. Process payment data in background\n(value: background).\nThen, the system will return\n(payment_id, payment_url, & status)\nin JSON format; in this case the other\nparty should redirect the user to\npayment URL.\nOtherwise, the system will\nreturn error code and error message\n(code & error) in JSON format.",
							"type": "text"
						},
						{
							"key": "required_fields",
							"value": "email,name,mobile",
							"description": "When you activate “API type 3”, you can\nidentify required fields that the customer\nshould fill them before precede payment.\nFields should be separated by comma “,”.\nAccepted fields:\n1. Customer email [email]\n2. Customer name [name]\n3. Customer mobile [mobile]\n4. Customer gender [gender]\n5. Customer address [address]",
							"type": "text"
						},
						{
							"key": "redirect_to_gateway",
							"value": "gateway_id",
							"description": "You can submit payment gateway id and the\nsystem will redirect the user to the selected\npayment gateway",
							"type": "text"
						},
						{
							"key": "callback_url",
							"value": "https://yourcallback.url",
							"description": "The system will post the result and then\nreturn to this URL.return to this URL.",
							"type": "text"
						},
						{
							"key": "show_callback",
							"value": "1",
							"description": "1. The API will show Gate-E Callback page\n(value: 1)\n2. The API will not show Gate-E Callback\npage (value: 0)",
							"type": "text"
						},
						{
							"key": "calculated_hash",
							"value": "YOUR_CALCULATED_HASH",
							"description": "The calculated hash will be calculated\naccording to posted data of the above list,\nand you need to put your API hash also. The\npayment will mention as validated if you use\nthis feature otherwise no.",
							"type": "text",
							"disabled": true
						},
						{
							"key": "auto_deduct",
							"value": "0",
							"description": "Accepted values:\n- 1: Pay using auto-deduct\n- 0: Pay without auto-deduct\nDefault value: 0",
							"type": "text"
						},
						{
							"key": "user_code",
							"value": "USERCODE123",
							"description": "User code used to save the payer cards\nunder its value",
							"type": "text"
						},
						{
							"key": "card_save",
							"value": "force",
							"description": "Accepted values:\n- “checked”: save card option is checked\nby default, but the customer can\nuncheck it.\n-\n“unchecked”: save card option is\nunchecked by default, but the customer\ncan check it.\n- “force”: force the customer to save the\ncard.\n- “disable”: disable the save card option.\nDefault value: “unchecked”",
							"type": "text"
						},
						{
							"key": "card_list",
							"value": "1",
							"description": "Accepted values:\n- 1: show saved cards’ list if available\n- 0: hide saved cards’ list if available",
							"type": "text"
						},
						{
							"key": "post_json",
							"value": "{\n  \"items\": [\n    {\n      \"title\": \"Item 1\",\n      \"amount\": \"2.5\",\n      \"currency\": \"BHD\",\n      \"quantity\": \"1\",\n      \"category\": \"Item Category\"\n    },\n    {\n      \"title\": \"Item 2\",\n      \"amount\": \"17.5\",\n      \"currency\": \"BHD\",\n      \"quantity\": \"1\",\n      \"category\": \"Item Category\"\n    }\n  ],\n  \"customer\": {\n    \"name\": \"Sayed Ammar\",\n    \"email\": \"sammar.falah@gate-e.com\",\n    \"register_date\": \"2024-06-25 12:16:52\",\n    \"mobile\":\"97317684511\",\n    \"loyalty_leve\":\"5\" // from 0-5\n  },\n  \"order_history\": [\n    {\n      \"date\": \"2023-10-05 12:51:28\",\n      \"amount\": \"0.9\",\n      \"currency\": \"BHD\",\n      \"status\": \"paid\",\n      \"payment_method\": \"Benefit\"\n    },\n    {\n      \"date\": \"2023-10-05 13:16:06\",\n      \"amount\": \"5.863\",\n      \"currency\": \"BHD\",\n      \"status\": \"paid\",\n      \"payment_method\": \"Benefit\"\n    }\n  ]\n}",
							"description": "you will send this data items \ncustomer\norder_history\nitems",
							"type": "text"
						},
						{
							"key": "email_send",
							"value": "0",
							"description": "Send the code link through email to\nclient/merchant or both.\nAccepted values:\n0: do not send\n1: send to client only\n2: send to merchant only\n3: send to both (merchant & client)",
							"type": "text"
						},
						{
							"key": "sms_send",
							"value": "0",
							"description": "Send the code link through SMS to\nclient/merchant or both.\nAccepted values:\n0: do not send\n1: send to client only\n2: send to merchant only\n3: send to both (merchant & client)",
							"type": "text"
						},
						{
							"key": "field1",
							"value": "any string String",
							"description": "You can enter any information you need, and\nsystem will return it back in callback. It is\nrequired calculated hash.",
							"type": "text"
						},
						{
							"key": "field2",
							"value": "any string String",
							"description": "You can enter any information you need, and\nsystem will return it back in callback. It is\nrequired calculated hash.",
							"type": "text"
						},
						{
							"key": "field3",
							"value": "any string String",
							"description": "You can enter any information you need, and\nsystem will return it back in callback. It is\nrequired calculated hash.",
							"type": "text"
						},
						{
							"key": "field4",
							"value": "any string String",
							"description": "You can enter any information you need, and\nsystem will return it back in callback. It is\nrequired calculated hash.",
							"type": "text"
						},
						{
							"key": "field5",
							"value": "any string String",
							"description": "You can enter any information you need, and\nsystem will return it back in callback. It is\nrequired calculated hash.",
							"type": "text"
						},
						{
							"key": "extra_field",
							"value": "any string String",
							"description": "You can enter any information you need, and\nsystem will return it back in callback.",
							"type": "text"
						},
						{
							"key": "name",
							"value": "customer name",
							"description": "Your customer name that he will pay the\namount, this information automatically will\npost it in registration form.",
							"type": "text"
						},
						{
							"key": "email",
							"value": "customer email",
							"description": "Your customer email will automatically post it\nin registration form.",
							"type": "text"
						},
						{
							"key": "mobile",
							"value": "",
							"description": "Your customer mobile will automatically post\nit in registration form.",
							"type": "text"
						},
						{
							"key": "gender",
							"value": "",
							"description": "Your customer gender (M/F) will automatically\npost it in registration form.",
							"type": "text"
						},
						{
							"key": "country",
							"value": "",
							"description": "Your customer country will automatically post\nit in registration form.",
							"type": "text"
						},
						{
							"key": "city",
							"value": "",
							"description": "Your customer city will automatically post it in\nregistration form.",
							"type": "text"
						},
						{
							"key": "address",
							"value": "",
							"description": "Your customer address will automatically post\nit in registration form.",
							"type": "text"
						},
						{
							"key": "note",
							"value": "",
							"description": "The customer can write note for company and\nthis field not calculated in hash.",
							"type": "text"
						},
						{
							"key": "send_address",
							"value": "",
							"description": "This option will post your customer address\nautomatically in the generated invoice after\nsuccessful payment. To activate this option,\nyou should post “YES”.",
							"type": "text"
						},
						{
							"key": "locale",
							"value": "",
							"description": "Set your custom language of the payment.\nAccepted values:\n1. en (English)\n2. ar (Arabic)",
							"type": "text"
						}
					]
				},
				"url": "https://www.test.gate-e.com/api/process.php"
			},
			"response": []
		},
		{
			"name": "Module 4: Get Payment",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "multipart/form-data"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "unique_id",
							"value": "{{unique_id}}",
							"description": "The unique ID of the company, you can get it\nfrom API Settings.",
							"type": "text"
						},
						{
							"key": "hash",
							"value": "{{hash}}",
							"description": "The hash will be calculated according to response data\nfrom the list above and your hash.",
							"type": "text"
						},
						{
							"key": "payment_id",
							"value": "1317696874590896",
							"description": "The payment ID generated by Gate-E, it is for reviewing\nthe payment.",
							"type": "text"
						}
					]
				},
				"url": "https://www.test.gate-e.com/api/getpayment.php"
			},
			"response": []
		},
		{
			"name": "Module 4: Update Payment",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "multipart/form-data"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "unique_id",
							"value": "{{unique_id}}",
							"description": "The unique ID of the company, you can get it from API\nSettings.",
							"type": "text"
						},
						{
							"key": "hash",
							"value": "{{hash}}",
							"description": "Hash of the company, you can get it from API\nSetting.",
							"type": "text"
						},
						{
							"key": "payment_id",
							"value": "1317696874590896",
							"description": "Payment ID that is returned to callback\nURL from Gate-E.",
							"type": "text"
						},
						{
							"key": "processed",
							"value": "1",
							"description": "Status of the payment that has been or not.\n(Accepted values: 0 / 1)",
							"type": "text"
						}
					]
				},
				"url": "https://www.test.gate-e.com/api/updatepayment.php"
			},
			"response": []
		},
		{
			"name": "Module 6: Get Payments by Reference",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "multipart/form-data"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "unique_id",
							"value": "{{unique_id}}",
							"description": "Unique ID of the company, you can get\nit from API Setting.",
							"type": "text"
						},
						{
							"key": "hash",
							"value": "{{hash}}",
							"description": "Hash of the company, you can get it from\nAPI Setting.",
							"type": "text"
						},
						{
							"key": "field",
							"value": "ref_code",
							"description": "Search using the following methods:\n• email\n• Mobile\n• field1\n• field2\n• field3\n• field4\n• field5\n• ref_code",
							"type": "text"
						},
						{
							"key": "value",
							"value": "REF12345",
							"description": "The value of field",
							"type": "text"
						}
					]
				},
				"url": "https://www.test.gate-e.com/api/getpayments.php"
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "unique_id",
			"value": "491772"
		},
		{
			"key": "hash",
			"value": "X8XBYADYZVPJV4R9ST5R8BIA525IQ9QO",
			"type": "string"
		}
	]
}