Package: decentro-in-collections-python-sdk
decentro-in-collections-python-sdkCollectionsTable of ContentsRequirementsInstallingGetting StartedAsyncRaw HTTP ResponseReferencedecentro.collections.generate_payment_linkdecentro.collections.get_transaction_statusdecentro.collections.issue_collect_requestdecentro.collections.issue_upi_refunddecentro.collections.validate_upi_handleRequirementsPython >=3.7Installingpipinstalldecentro-in-collections-python-sdk==1.0.0Getting Startedfrompprintimportpprintfromdecentro_in_collections_clientimportDecentro,ApiExceptiondecentro=Decentro(client_id="YOUR_API_KEY",client_secret="YOUR_API_KEY",module_secret="YOUR_API_KEY",provider_secret="YOUR_API_KEY",)try:# Generate payment linkgenerate_payment_link_response=decentro.collections.generate_payment_link(reference_id="ABCDEF12345",payee_account="00000000000000000",amount=4,purpose_message="Welcome to Decentro",generate_qr=0,expiry_time=10,customized_qr_with_logo=0,generate_uri=0,)print(generate_payment_link_response)exceptApiExceptionase:print("Exception when calling CollectionsApi.generate_payment_link:%s\n"%e)pprint(e.body)ife.status==400:pprint(e.body["decentroTxnId"])pprint(e.body["status"])pprint(e.body["responseCode"])pprint(e.body["message"])pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Asyncasyncsupport is available by prependingato any method.importasynciofrompprintimportpprintfromdecentro_in_collections_clientimportDecentro,ApiExceptiondecentro=Decentro(client_id="YOUR_API_KEY",client_secret="YOUR_API_KEY",module_secret="YOUR_API_KEY",provider_secret="YOUR_API_KEY",)asyncdefmain():try:# Generate payment linkgenerate_payment_link_response=(awaitdecentro.collections.agenerate_payment_link(reference_id="ABCDEF12345",payee_account="00000000000000000",amount=4,purpose_message="Welcome to Decentro",generate_qr=0,expiry_time=10,customized_qr_with_logo=0,generate_uri=0,))print(generate_payment_link_response)exceptApiExceptionase:print("Exception when calling CollectionsApi.generate_payment_link:%s\n"%e)pprint(e.body)ife.status==400:pprint(e.body["decentroTxnId"])pprint(e.body["status"])pprint(e.body["responseCode"])pprint(e.body["message"])pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)asyncio.run(main())Raw HTTP ResponseTo access raw HTTP response values, use the.rawnamespace.frompprintimportpprintfromdecentro_in_collections_clientimportDecentro,ApiExceptiondecentro=Decentro(client_id="YOUR_API_KEY",client_secret="YOUR_API_KEY",module_secret="YOUR_API_KEY",provider_secret="YOUR_API_KEY",)try:# Generate payment linkgenerate_payment_link_response=decentro.collections.raw.generate_payment_link(reference_id="ABCDEF12345",payee_account="00000000000000000",amount=4,purpose_message="Welcome to Decentro",generate_qr=0,expiry_time=10,customized_qr_with_logo=0,generate_uri=0,)pprint(generate_payment_link_response.body)pprint(generate_payment_link_response.body["decentroTxnId"])pprint(generate_payment_link_response.body["status"])pprint(generate_payment_link_response.body["responseCode"])pprint(generate_payment_link_response.body["message"])pprint(generate_payment_link_response.body["data"])pprint(generate_payment_link_response.body["responseKey"])pprint(generate_payment_link_response.headers)pprint(generate_payment_link_response.status)pprint(generate_payment_link_response.round_trip_time)exceptApiExceptionase:print("Exception when calling CollectionsApi.generate_payment_link:%s\n"%e)pprint(e.body)ife.status==400:pprint(e.body["decentroTxnId"])pprint(e.body["status"])pprint(e.body["responseCode"])pprint(e.body["message"])pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Referencedecentro.collections.generate_payment_linkGenerate payment link🛠️ Usagegenerate_payment_link_response=decentro.collections.generate_payment_link(reference_id="ABCDEF12345",payee_account="00000000000000000",amount=4,purpose_message="Welcome to Decentro",generate_qr=0,expiry_time=10,customized_qr_with_logo=0,generate_uri=0,)⚙️ Parametersreference_id:strpayee_account:stramount:Union[int, float]purpose_message:strgenerate_qr:intexpiry_time:intcustomized_qr_with_logo:intgenerate_uri:int⚙️ Request BodyGeneratePaymentLinkRequest🔄 ReturnGeneratePaymentLinkResponse🌐 Endpoint/v2/payments/upi/linkpost🔙Back to Table of Contentsdecentro.collections.get_transaction_statusGet transaction status🛠️ Usageget_transaction_status_response=decentro.collections.get_transaction_status(transaction_id="transaction_id_example",)⚙️ Parameterstransaction_id:str🔄 ReturnGetTransactionStatusResponse🌐 Endpoint/v2/payments/transaction/{transaction_id}/statusget🔙Back to Table of Contentsdecentro.collections.issue_collect_requestIssue collect request🛠️ Usageissue_collect_request_response=decentro.collections.issue_collect_request(reference_id="ABCDEF12345",payer_upi="test001@abc",payee_account="00000000000000000",amount=1,purpose_message="Welcome to Decentro",expiry_time=30,)⚙️ Parametersreference_id:strpayer_upi:strpayee_account:stramount:Union[int, float]purpose_message:strexpiry_time:int⚙️ Request BodyIssueCollectRequestRequest🔄 ReturnIssueCollectRequestResponse🌐 Endpoint/v2/payments/collectionpost🔙Back to Table of Contentsdecentro.collections.issue_upi_refundIssue UPI Refund🛠️ Usageissue_upi_refund_response=decentro.collections.issue_upi_refund(reference_id="ABCDEF12345",transaction_id="4CE9587AE3D143CDAC72E7D0CF14D028",bank_reference_number="111111111111",purpose_message="Welcome to Decentro",)⚙️ Parametersreference_id:strtransaction_id:strbank_reference_number:strpurpose_message:str⚙️ Request BodyIssueUpiRefundRequest🔄 ReturnIssueUpiRefundResponse🌐 Endpoint/v2/payments/upi/refundpost🔙Back to Table of Contentsdecentro.collections.validate_upi_handleValidate UPI handle🛠️ Usagevalidate_upi_handle_response=decentro.collections.validate_upi_handle(reference_id="ABCDEF12345",upi_id="test001@abc",type="BASIC",)⚙️ Parametersreference_id:strupi_id:strtype:str⚙️ Request BodyValidateUpiHandleRequest🔄 ReturnValidateUpiHandleResponse🌐 Endpoint/v2/payments/vpa/validatepost🔙Back to Table of Contents