{
	"info": {
		"_postman_id": "dealer-api-collection",
		"name": "Acid Panel - Dealer API",
		"description": "Dealer Integration API endpoints for Acid Panel - For merchants and dealers to accept payments from customers",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{
			"key": "base_url",
			"value": "https://acidpanel.net",
			"type": "string"
		},
		{
			"key": "api_key",
			"value": "YOUR_DEALER_API_KEY",
			"type": "string"
		},
		{
			"key": "secret_key",
			"value": "YOUR_DEALER_SECRET_KEY",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "1. Dealer Settings",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"url": {
					"raw": "{{base_url}}/api/dealer/settings",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "settings"]
				},
				"description": "Get dealer configuration and status information.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "GET",
						"url": {
							"raw": "{{base_url}}/api/dealer/settings"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"message\": \"Welcome, Demo Dealer\",\n  \"dealer_name\": \"Demo Dealer\",\n  \"payment_methods\": {\n    \"credit_card\": \"active\",\n    \"eiban\": \"active\",\n    \"manual_iban\": \"inactive\"\n  }\n}"
				}
			]
		},
		{
			"name": "2. E-IBAN Query",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"url": {
					"raw": "{{base_url}}/api/dealer/eibans",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "eibans"]
				},
				"description": "Get all assigned E-IBANs with current balances.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "GET",
						"url": {
							"raw": "{{base_url}}/api/dealer/eibans"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"dealer_name\": \"Demo Dealer\",\n  \"total_eibans\": 2,\n  \"eibans\": [\n    {\n      \"id\": 1,\n      \"iban_no\": \"TR330006100519786457841326\",\n      \"bank_name\": \"Garanti BBVA\",\n      \"account_name\": \"Demo Account\",\n      \"wallet_id\": \"ABC123XYZ\",\n      \"balance\": \"125000.00\",\n      \"available_balance\": \"120000.00\"\n    },\n    {\n      \"id\": 2,\n      \"iban_no\": \"TR440006200619786457841327\",\n      \"bank_name\": \"Akbank\",\n      \"account_name\": \"Demo Account 2\",\n      \"wallet_id\": \"DEF456UVW\",\n      \"balance\": \"50000.00\",\n      \"available_balance\": \"50000.00\"\n    }\n  ]\n}"
				}
			]
		},
		{
			"name": "3. E-IBAN Transaction History",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"url": {
					"raw": "{{base_url}}/api/dealer/transactions?wallet_id=YOUR_WALLET_ID&start_date=2025-12-01&end_date=2025-12-03&page=1",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "transactions"],
					"query": [
						{
							"key": "wallet_id",
							"value": "YOUR_WALLET_ID",
							"description": "Wallet ID from E-IBAN query"
						},
						{
							"key": "start_date",
							"value": "2025-12-01",
							"description": "Start date (YYYY-MM-DD)"
						},
						{
							"key": "end_date",
							"value": "2025-12-03",
							"description": "End date (YYYY-MM-DD) - Max 3 days range"
						},
						{
							"key": "page",
							"value": "1",
							"description": "Page number (default: 1)"
						}
					]
				},
				"description": "Query E-IBAN transaction history.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp\n\n**Query Parameters:**\n- wallet_id: Wallet ID from E-IBAN query (required)\n- start_date: Start date YYYY-MM-DD (required)\n- end_date: End date YYYY-MM-DD (required, max 3 days range)\n- page: Page number (optional, default: 1)\n\n**Pagination:**\n- Results are paginated with 100 records per page\n- Check 'has_more' in response for more pages"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "GET",
						"url": {
							"raw": "{{base_url}}/api/dealer/transactions?wallet_id=ABC123XYZ&start_date=2025-12-01&end_date=2025-12-03&page=1"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"dealer_name\": \"Demo Dealer\",\n  \"wallet_id\": \"ABC123XYZ\",\n  \"date_range\": {\n    \"start_date\": \"2025-12-01\",\n    \"end_date\": \"2025-12-03\"\n  },\n  \"pagination\": {\n    \"current_page\": 1,\n    \"per_page\": 100,\n    \"total_records\": 250,\n    \"total_pages\": 3,\n    \"has_more\": true\n  },\n  \"transactions\": [\n    {\n      \"transactionId\": \"TXN123456\",\n      \"amount\": \"1500.00\",\n      \"type\": \"incoming\",\n      \"description\": \"EFT Transfer\",\n      \"senderName\": \"JOHN DOE\",\n      \"senderIban\": \"TR1234567890123456789012\",\n      \"date\": \"2025-12-01T14:30:00\"\n    }\n  ]\n}"
				},
				{
					"name": "Date Range Exceeded Error",
					"originalRequest": {
						"method": "GET",
						"url": {
							"raw": "{{base_url}}/api/dealer/transactions?wallet_id=ABC123XYZ&start_date=2025-12-01&end_date=2025-12-10&page=1"
						}
					},
					"status": "Bad Request",
					"code": 400,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": false,\n  \"message\": \"Date range cannot exceed 3 days\",\n  \"error_code\": \"DATE_RANGE_EXCEEDED\"\n}"
				}
			]
		},
		{
			"name": "4. E-IBAN Send Money",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"wallet_id\": \"ABC123XYZ\",\n  \"recipient_iban\": \"TR330006100519786457841326\",\n  \"recipient_name\": \"JOHN DOE\",\n  \"amount\": 1500.00,\n  \"description\": \"Withdrawal payment\"\n}"
				},
				"url": {
					"raw": "{{base_url}}/api/dealer/send-money",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "send-money"]
				},
				"description": "Initiate money transfer from your E-IBAN to customer's bank account.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp\n\n**Request Body:**\n- wallet_id: Source E-IBAN wallet ID (required)\n- recipient_iban: Recipient's IBAN number (required)\n- recipient_name: Recipient's full name (required)\n- amount: Transfer amount, min 10.00 TRY (required)\n- description: Transfer description/note (optional)"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"url": {
							"raw": "{{base_url}}/api/dealer/send-money"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"message\": \"Transfer initiated successfully\",\n  \"transfer\": {\n    \"transfer_id\": \"TRF-ABC123XYZ\",\n    \"status\": \"pending\",\n    \"amount\": \"1500.00\",\n    \"recipient_iban\": \"TR330006100519786457841326\",\n    \"recipient_name\": \"JOHN DOE\",\n    \"created_at\": \"2025-12-04T14:30:00\"\n  }\n}"
				},
				{
					"name": "Insufficient Balance Error",
					"originalRequest": {
						"method": "POST",
						"url": {
							"raw": "{{base_url}}/api/dealer/send-money"
						}
					},
					"status": "Bad Request",
					"code": 400,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": false,\n  \"message\": \"Insufficient balance in source E-IBAN\",\n  \"error_code\": \"INSUFFICIENT_BALANCE\"\n}"
				}
			]
		},
		{
			"name": "5. E-IBAN Transfer Status",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"url": {
					"raw": "{{base_url}}/api/dealer/transfer-status?transfer_id=TRF-ABC123XYZ",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "transfer-status"],
					"query": [
						{
							"key": "transfer_id",
							"value": "TRF-ABC123XYZ",
							"description": "Transfer ID from Send Money API"
						}
					]
				},
				"description": "Check the status of a previously initiated E-IBAN money transfer.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp\n\n**Query Parameters:**\n- transfer_id: Transfer ID returned from Send Money API"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "GET",
						"url": {
							"raw": "{{base_url}}/api/dealer/transfer-status?transfer_id=TRF-ABC123XYZ"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"dealer_name\": \"Demo Dealer\",\n  \"transfer\": {\n    \"transfer_id\": \"TRF-ABC123XYZ\",\n    \"status\": \"completed\",\n    \"amount\": \"1500.00\",\n    \"recipient_iban\": \"TR330006100519786457841326\",\n    \"recipient_name\": \"JOHN DOE\",\n    \"description\": \"Withdrawal payment\",\n    \"created_at\": \"2025-12-04T14:30:00\",\n    \"completed_at\": \"2025-12-04T14:32:15\"\n  }\n}"
				}
			]
		},
		{
			"name": "6. Credit Card Payment",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"username\": \"user123\",\n  \"firstname\": \"John\",\n  \"lastname\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"phone\": \"5551234567\",\n  \"amount\": 500.00,\n  \"description\": \"Payment for order #123\"\n}"
				},
				"url": {
					"raw": "{{base_url}}/api/dealer/credit-card/payment",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "credit-card", "payment"]
				},
				"description": "Create credit card payment for customer.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp\n\n**Request Body:**\n- username: Customer username\n- firstname: First name\n- lastname: Last name\n- email: Email address\n- phone: Phone number (without country code)\n- amount: Payment amount\n- description: (optional) Payment description"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"url": {
							"raw": "{{base_url}}/api/dealer/credit-card/payment"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"message\": \"Payment created successfully\",\n  \"data\": {\n    \"tracking_code\": \"CC-A1B2C3D4-1733312400\",\n    \"payment_url\": \"https://payment.gateway.com/pay/abc123\",\n    \"order_id\": \"CC-20251126-ABC123\",\n    \"amount\": 500.00,\n    \"currency\": \"TRY\"\n  }\n}"
				}
			]
		}
		{
			"name": "7. Manual IBAN Deposit",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"username\": \"user123\",\n  \"userid\": \"U123456\",\n  \"fullname\": \"John Doe\",\n  \"amount\": 500.00\n}"
				},
				"url": {
					"raw": "{{base_url}}/api/dealer/manual-iban/deposit",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "manual-iban", "deposit"]
				},
				"description": "Get an available manual IBAN for deposit based on amount limits.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp\n\n**Request Body:**\n- username: Customer username\n- userid: Customer user ID\n- fullname: Customer full name\n- amount: Deposit amount"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"url": {
							"raw": "{{base_url}}/api/dealer/manual-iban/deposit"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"message\": \"Uygun IBAN bulundu.\",\n  \"data\": {\n    \"tracking_code\": \"DEP-ABC123XYZ-1733312400\",\n    \"bank_name\": \"Garanti Bankası\",\n    \"account_name\": \"Ahmet Yılmaz\",\n    \"iban_no\": \"TR123456789012345678901234\",\n    \"amount\": 500.00,\n    \"formatted_iban\": \"TR12 3456 7890 1234 5678 9012 34\"\n  }\n}"
				}
			]
		},
		{
			"name": "8. Manual IBAN Withdraw",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"const apiKey = pm.collectionVariables.get('api_key');",
							"const secretKey = pm.collectionVariables.get('secret_key');",
							"const timestamp = Math.floor(Date.now() / 1000).toString();",
							"const hash = CryptoJS.SHA256(apiKey + secretKey + timestamp).toString();",
							"",
							"pm.request.headers.add({ key: 'X-Api-Key', value: apiKey });",
							"pm.request.headers.add({ key: 'X-Hash', value: hash });",
							"pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"username\": \"user123\",\n  \"userid\": \"U123456\",\n  \"amount\": 250.00,\n  \"recipient_name\": \"Mehmet Demir\",\n  \"recipient_iban\": \"TR987654321098765432109876\"\n}"
				},
				"url": {
					"raw": "{{base_url}}/api/dealer/manual-iban/withdraw",
					"host": ["{{base_url}}"],
					"path": ["api", "dealer", "manual-iban", "withdraw"]
				},
				"description": "Create a withdrawal request to be processed manually.\n\n**Required Headers:**\n- X-Api-Key: Your Dealer API Key\n- X-Hash: SHA256(api_key + secret_key + timestamp)\n- X-Timestamp: Current Unix timestamp\n\n**Request Body:**\n- username: Customer username\n- userid: Customer user ID\n- amount: Withdrawal amount\n- recipient_name: Recipient's full name\n- recipient_iban: Recipient's IBAN"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"url": {
							"raw": "{{base_url}}/api/dealer/manual-iban/withdraw"
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"body": "{\n  \"success\": true,\n  \"message\": \"Çekim talebi alındı.\",\n  \"data\": {\n    \"tracking_code\": \"WDR-XYZ789ABC-1733312400\",\n    \"status\": \"pending\",\n    \"amount\": 250.00,\n    \"recipient_name\": \"Mehmet Demir\",\n    \"recipient_iban\": \"TR987654321098765432109876\"\n  }\n}"
				}
			]
		}
	]
}
