Package: incognia-python
Incognia API Python Client 🐍InstallationYou can install the IncogniaAPI using the following command:pipinstallincognia-pythonUsageConfigurationBefore calling the API methods, you need to create an instance of theIncogniaAPIclass.fromincognia.apiimportIncogniaAPIapi=IncogniaAPI('client-id','client-secret')Incognia APIThe implementation is based on theIncognia API Reference.AuthenticationAuthentication is done transparently, so you don't need to worry about it.Registering New SignupThis method registers a new signup for the given installation and a structured address, an address
line or coordinates, returning adict, containing the risk assessment and supporting evidence:fromincognia.apiimportIncogniaAPIfromincognia.modelsimportStructuredAddress,Coordinatesapi=IncogniaAPI('client-id','client-secret')# with structured address, a dict:structured_address:StructuredAddress={'locale':'en-US','country_name':'United States of America','country_code':'US','state':'NY','city':'New York City','borough':'Manhattan','neighborhood':'Midtown','street':'W 34th St.','number':'20','complements':'Floor 2','postal_code':'10001'}assessment:dict=api.register_new_signup('installation-id',structured_address=structured_address)# with address line:address_line:str='350 Fifth Avenue, Manhattan, New York 10118'assessment:dict=api.register_new_signup('installation-id',address_line=address_line)# with coordinates, a dict:coordinates:Coordinates={'lat':40.74836007062138,'lng':-73.98509720487937}assessment:dict=api.register_new_signup('installation-id',address_coordinates=coordinates)Getting a SignupThis method allows you to query the latest assessment for a given signup event, returning adict,
containing the risk assessment and supporting evidence:fromincognia.apiimportIncogniaAPIapi=IncogniaAPI('client-id','client-secret')assessment:dict=api.get_signup_assessment('signup-id')Registering FeedbackThis method registers a feedback event for the given identifiers (optional arguments) related to a
signup, login or payment.importdatetimeasdtfromincognia.apiimportIncogniaAPIfromincognia.feedback_eventsimportFeedbackEvents# feedbacks are strings.api=IncogniaAPI('client-id','client-secret')api.register_feedback(FeedbackEvents.SIGNUP_ACCEPTED,dt.datetime.now(),installation_id='installation-id',account_id='account-id',signup_id='signup-id')Registering PaymentThis method registers a new payment for the given installation and account, returning adict,
containing the risk assessment and supporting evidence.fromtypingimportListfromincognia.apiimportIncogniaAPIfromincognia.modelsimportTransactionAddress,PaymentValue,PaymentMethodapi=IncogniaAPI('client-id','client-secret')addresses:List[TransactionAddress]=[{'type':'shipping','structured_address':{'locale':'pt-BR','country_name':'Brasil','country_code':'BR','state':'SP','city':'São Paulo','borough':'','neighborhood':'Bela Vista','street':'Av. Paulista','number':'1578','complements':'Andar 2','postal_code':'01310-200'},'address_coordinates':{'lat':-23.561414,'lng':-46.6558819}}]payment_value:PaymentValue={'amount':5.0,'currency':'BRL'}payment_methods:List[PaymentMethod]=[{'type':'credit_card','credit_card_info':{'bin':'123456','last_four_digits':'1234','expiry_year':'2027','expiry_month':'10'}},{'type':'debit_card','debit_card_info':{'bin':'123456','last_four_digits':'1234','expiry_year':'2027','expiry_month':'10'}}]assessment:dict=api.register_payment('installation-id','account-id','external-id',addresses=addresses,payment_value=payment_value,payment_methods=payment_methods)Registering LoginThis method registers a new login for the given installation and account, returning adict,
containing the risk assessment and supporting evidence.fromincognia.apiimportIncogniaAPIapi=IncogniaAPI('client-id','client-secret')assessment:dict=api.register_login('installation-id','account-id','external-id')EvidencesEvery assessment response includes supporting evidence in a dict. You can find all available
evidenceshere.Error HandlingEvery method call can throwIncogniaHTTPErrorandIncogniaError.IncogniaHTTPErroris thrown when the API returned an unexpected http status code.IncogniaErrorrepresents unknown errors, like required parameters none or empty.How to ContributeIf you have found a bug or if you have a feature request, please report them at this repository
issues section.What is Incognia?Incognia is a location identity platform for mobile apps that enables:Real-time address verification for onboardingFrictionless authenticationReal-time transaction verificationCreate a Free Incognia AccountGo toIncogniaand click on "Sign Up For Free"Create an AccountYou're ready to integrateIncognia SDKand
useIncognia APIsLicense