Python Finnotech Api Client
Install using pypi:
pip install pyfinnotech
Home Page: https://finnotech.ir/
Api Doc: https://apibeta.finnotech.ir/
Sandbox Dashboard Url: https://sandboxbeta.finnotech.ir/
Mainnet Dashboard Url: https://devbeta.finnotech.ir/
Initialize api client:
from pyfinnotech import FinnotechApiClient
api_client = FinnotechApiClient(client_id='MY-CLIENT-ID', client_secret='MY-CLIENT-SECRET', client_national_id='0067408595')
Inquire Sheba:
result = api_client.iban_inquiry('IR910800005000115426432001')
Inquire Card:
result = api_client.card_inquiry('0000000000000000')
Card to iban:
result = api_client.card_to_iban('0000000000000000')
Retrieve sms authorization token:
sms_facility_access_token = None
result1 = FacilitySmsAccessTokenToken.request_sms(
api_client,
target_phone='09300000000',
scopes=[SCOPE_FACILITY_SMS_NID_VERIFICATION_GET, ],
redirect_url='http://localhost/finnotech-callback'
)
tracking_id = result1.track_id
print(ujson.dumps(result1.payload, indent=4, sort_keys=True, ensure_ascii=False))
otp = input("Enter otp: ").strip()
result2 = FacilitySmsAccessTokenToken.verify_sms(
api_client,
target_phone='09300000000',
track_id=tracking_id,
target_national_id='0067408595',
otp=otp
)
print(ujson.dumps(result2.payload, indent=4, sort_keys=True, ensure_ascii=False))
code = result2.code
token = FacilitySmsAccessTokenToken.request_token(
api_client,
code=code,
redirect_url='http://localhost/finnotech-callback'
)
print(token.token)
And for refreshing it:
token.refresh(api_client)
First retrieve sms_authorization_token
from the target user
verification_result = api_client.national_id_verification(
access_token=token,
birth_date='1365/11/25',
first_name='سعید',
national_id='0067408595',
gender='مرد'
)