You need to enable JavaScript to use this application.
POST استعلام

Deposits Account National Code Match API

این API برای تطابق کد ملی ارسال شده با کد ملی صاحب سپرده استفاده می‌شود. در صورت تطابق، اطلاعات سپرده و وضعیت تطابق برگردانده می‌شود و در صورت عدم تطابق یا نبود دسترسی، خطای مناسب ارائه می‌گردد.

POST /api/services/deposits-account-national-code-match/
نیاز به احراز هویت Token 60 requests/minute

مستندات

Overview

Overview

The Deposits Account National Code Match API validates whether the provided national code belongs to the owner of the specified deposit account or IBAN. For IBAN requests the upstream response contains a simple match flag.

Authentication

Authentication

Send both headers in every request:

Authorization: Token YOUR_AUTH_TOKEN
X-Unique-Code: YOUR_UNIQUE_CODE
Bank-Id: MELIIR

Bank-Id header is required when querying by deposit account number. For IBAN lookups, the service currently accepts empty Bank-Id values.

Request Format

Request Format

Send a POST request with JSON body:

{
  "account": "0219950976002",
  "national_code": "4640229534",
  "bank_id": ""
}

برای شبا می‌توانید مقدار account را برابر IBAN قرار دهید و bank_id را خالی بفرستید.

Ensure the national code matches the account owner's identity.

Response Format

Response Format

Successful responses include owner name, deposit metadata, and the match flag. Error responses follow the platform's standard structure with operation_time, ref_id, and detailed errors.

Error Handling

Error Handling

Common platform error codes:

  • 1002: بانک انتخاب نشده (Bank-Id header missing).
  • 1027: دسترسی برنامه برای بانک فعال نیست.
  • Validation errors for invalid national codes or accounts.

Best Practices

Best Practices

  • Validate national code format on the client before sending.
  • Cache positive match results when business policies allow.
  • Log the ref_id for audit and support purposes.
  • Handle platform error codes to surface meaningful feedback to users.

پارامترهای درخواست

پارامتر نوع اجباری توضیحات مثال
account String اجباری شماره سپرده یا شبا. برای شبا باید با IR شروع شود و ۲۶ کاراکتر باشد.
اعتبارسنجی: IBAN: طول ۲۶، پس از IR فقط ارقام. Account: فقط عددی، حداقل ۶ رقم.
IR110170000000219950976002
national_code String اجباری کد ملی صاحب سپرده. برای اشخاص حقیقی ۱۰ رقم، اشخاص حقوقی ۱۱ رقم و اتباع بین ۱۲ تا ۱۵ رقم.
اعتبارسنجی: Numeric, length 10/11/12-15, checksum اعمال برای اشخاص حقیقی.
4640229534
bank_id String اختیاری شناسه بانک مقصد. در صورت نامشخص بودن، مقدار خالی ارسال کنید؛ بعضی بانک‌ها مقدار مشخص می‌خواهند.
اعتبارسنجی: Optional string. برای بانک‌هایی که شناسه مشخص دارند مقدار مناسب ارسال شود.
-

مثال‌های کد

Python Example

Example using Python requests library.

import requests

url = "https://inquiry.sepal.ir/api/services/deposits-account-national-code-match/"
headers = {
    "Authorization": "Token YOUR_AUTH_TOKEN",
    "X-Unique-Code": "YOUR_UNIQUE_CODE",
    "Content-Type": "application/json",
}
payload = {
    "account": "0219950976002",
    "national_code": "4640229534",
    "bank_id": ""
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
cURL Example

Command-line cURL example.

curl -X POST "https://inquiry.sepal.ir/api/services/deposits-account-national-code-match/" \
  -H "Authorization: Token YOUR_AUTH_TOKEN" \
  -H "X-Unique-Code: YOUR_UNIQUE_CODE" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "0219950976002",
    "national_code": "4640229534",
    "bank_id": ""
  }'

فرمت پاسخ

200
پاسخ موفق

پاسخ موفق شامل اطلاعات سپرده و وضعیت تطابق.

ساختار پاسخ:
{
  "amount": "integer",
  "success": "boolean",
  "request_ref": "string",
  "error_message": "null",
  "response_data": {
    "match": "boolean",
    "ref_id": "string",
    "operation_time": "integer"
  },
  "response_time_ms": "integer"
}
مثال پاسخ:
{
  "amount": 15000,
  "success": true,
  "request_ref": "PAKM32SOR28OTCUAJX2V3UF7J8XQJT33",
  "error_message": null,
  "response_data": {
    "match": true,
    "ref_id": "9e7ff9f3-a0e9-43e5-9ec8-6d90b993dda2",
    "operation_time": 1762691215312
  },
  "response_time_ms": 220
}
400
خطا

پارامتر ورودی نامعتبر است.

ساختار پاسخ:
{
  "error": {
    "errors": "list",
    "ref_id": "string",
    "operation_time": "integer"
  },
  "success": "boolean"
}
مثال پاسخ:
{
  "error": {
    "errors": [
      {
        "code": "1002",
        "message": "ارسال شناسه بانک در header اجباری می باشد",
        "reference": "BANK-ID"
      }
    ],
    "ref_id": "c527a9c1-04bd-49ed-b113-bba1e493c243",
    "operation_time": 1762673346784
  },
  "success": false
}
403
خطا

دسترسی به بانک مورد نظر برای برنامه فعال نشده است.

ساختار پاسخ:
{
  "error": {
    "errors": "list",
    "ref_id": "string",
    "operation_time": "integer"
  },
  "success": "boolean"
}
مثال پاسخ:
{
  "error": {
    "errors": [
      {
        "code": "1027",
        "message": "دسترسی این برنامه برای بانک درخواست شده برقرار نمی باشد"
      }
    ],
    "ref_id": "35e36e3f-70e8-4451-bdfb-601575c8b0ee",
    "operation_time": 1762673401463
  },
  "success": false
}