Micro-Payment APIs
This solution by Pay1 includes common APIs for multiple micro payments services. The processing of data is done on a real-time basis. We will be providing a single wallet for all settlements with strong security layers. You don't need to lock in large amounts in wallet balances leading to a better capital utilization for your company.
API Docs
Recharge API URL :-https://<url>/api/recharge/receiveApi?partner_id=ACCOUNT_ID&operation_type=1&operator=OP_CODE&number=NUMBER&amount=AMT&trans_id=TRANS_ID&special=STV Method GET/POSTHeaders :- Authorization and Token: As mentioned in headers sectionParams :- ACCOUNT_ID : e.g P0001234 (Account id of a merchant)OP_CODE : e.g. 15 (It is the operator code. Eg. 15 is code for vodafone)NUMBER : e.g. 9182191923 / 015121112121 (Mobile number in case of mobile recharges & Subscriber id in case of dth recharges)AMT : e.g. 100 (Recharge amount)TRANS_ID : e.g. 138162617281 (Unique Request id of the merchant for each request)STV : 0/1, 0 in case of normal topup & 1 in case of Special Tarriff Voucher/ValidityResponse ExampleOutput will be in the form of JSONa) Successful Transaction{"status":"success","partner_reqid":"138162617281","ref_code":"2082121121","errCode":"0","desc ription":"Successful transaction .","balance":"147.50"}b) Failure Transaction{"status":"failure","partner_reqid":"138162617281","ref_code":"2082121121","errCode":"E001","d escription":"Invalid Partner Id."}Notes:1. Value of status can only be success/failure2. partner_reqid is the unique transaction id sent by merchant at the time of request3. ref_code is the unique pay1 transaction id4. errCode is the error code of the error generated in case of a failure else it will be null5. description contains the cause of the failure
Transaction Check API URL :-https://<url>/api/recharge/receiveApi?partner_id=ACCOUNT_ID&operation_type=3&trans_id=TRANS_IDSMethod : GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :- ACCOUNT_ID : P0001234 (Account id of a merchant)TRANS_IDS : 138162617281,1381626 (It contains comma seperated unique request ids of 17282,138162617283 the merchant. Maximum number of ids allowed in each request are 10)Response ExampleOutput will be in the form of JSONa) Successful Transaction{"status":"success","req_id":"138162617281","trans_id":"21572929929","errCode":"0","description ":"Successful transaction ."}b) Failure Transaction/Invalid Transaction{"status":"failure","req_id":"138162617281","trans_id":"21572929929","errCode":"E015","descripti on":"Invalid Transaction Id."}Notes:1. Value of status can only be success/failure2. failure can also come in cases of transaction does not exists/hash given is not proper/invalid inputs given etc3. req_id is the merchant unique transaction id4. trans_id is the unique pay1 transaction id
Balance Check APIURL :-https://<url>/api/recharge/receiveApi?partner_id=ACCOUNT_ID&operation_type=2&trans_id=RANDOM_NUMMethod :- GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :- ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)RANDOM_NUM : e.g 52612 (Generate one random number and send it with request)Response Example :- Output will be in the form of JSONa) Successful Response{"status":"success","balance":"144.50"}b) Failure Transaction{"status":"failure","errCode":"E005","description":"Authentication Error"}Notes:1. Value of status can only be success/failure2. failure will come in cases of some error in inputs
Auto Status Update UrlURL : https://<merchant-url>One automatic hit will be sent by us on every success or a failure of a transaction & money will be refunded to the merchant at that instant only. Parameters will be sent by post methodPost Parametersclient_req_id : e.g. 1212134321212 (Unique transaction id of the merchant)trans_id : e.g. 2082121121 (10 digit unique transaction id of pay1)status : failure (It will be failure always in case of auto update)err_code : E001 (Error code if any error caused)description : Invalid Operation Type (Description of errors)operator_id : 1407316410 (Operator txn id)hash_code : SHA1 of ACCOUNT_ID+client_req_id+API_KEY
Complaint API URL :- https://<url>/api/recharge/receiveApi?partner_id=ACCOUNT_ID&operation_type=4&trans_id=TRANS_IDMethod :- GET/POSTHeaders :- Authorization and Token: As mentioned in headers sectionInput Parameters :- ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)TRANS_ID : e.g. 138162617281 (It contains txn id for which complaint needs to be raised)Response Example :-Output will be in the form of JSONSuccessful Complaint{"status":"success","description":"Complaint taken successfully"}Failure Complaint{"status":"failure","errCode":"E015","description":"Invalid Transaction Id."}Notes:1. Value of status can only be success/failure2. failure can also come in cases of transaction does not exists/hash given is not proper/invalid inputs given etc3. turnaround_time is the min time required to resolve the complaint. It will come in hours unit
Complaint Status Check Api URL :- https://<url>/api/recharge/receiveApi?partner_id=ACCOUNT_ID&operation_type=5&trans_id=COMPLAINT_IDMethod :- GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :- ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)COMPLAINT_ID : e.g. 1249384 (It is the complaint id received in the response while raising a complaint)Response Example :-Output will be in the form of JSONComplaint resolved{"status":"success","description":"Complaint resolved successfully. Please check txn status again"}Complaint unresolved{"status":"pending","errCode":"E029","description":"Your complaint is still pending"}Other failures{"status":"failure","errCode":"E028","description":"No such complaint exists"}Notes :-1. Value of status can be success/failure/pending
MNP Mobile number check API URL :- https://<url>/api/recharge/mnpCheck?partner_id=ACCOUNT_ID&trans_id=RANDOM_NU M&mobile=NUMBERMethod :- GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :-ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)RANDOM_NUM : e.g. 52612 (Generate one random number and send it with request)NUMBER : e.g. 9182191923 (Mobile number)Response Example :-Output will be in the form of JSONa) Successful Transaction{"status":"success","data":{“opr_code":"15","circle":"UW"}}b) Failure Transaction{"status":"failure","errCode":"E008","description":"Unable to fetch operator details"}Notes :-1. Value of status can only be success/failure2. description contains the cause of the failure3. opr_code is the operator code4. circle is the circle code to which mobile number belongs to
DTH Info API URL :- https://<url>/api/recharge/dthInfo?partner_id=ACCOUNT_ID&trans_id=RANDOM_NU M&number=SUBID&operator=OP_CODEMethod :- GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :- ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)RANDOM_NUM : e.g. 52612 (Generate one random number and send it with request)SUBID : e.g. 9182191923 (Subscriber ID of the dth operator)OP_CODE : e.g. 18 (It is the operator code. Eg. 16 is code for Dish Tv)Response Example :-a) Success{"status":"success","data":{"customer_id":"3005325038","name":"MR Sudhakar M","reg_mobileno":"8978202167","curr_balance":"7.22","monthly_pack":"380.76","nxt_recharge_date":"2020-04-28","address":"house no 1/21 village potharati palli mandal anthol dist medak","pin_code":"502001"}}b) Failure{"status":"failure",”errCode”:”E008”,"description":"Unable to fetch dth info"}Notes:1. Value of status can only be success/failure2. description contains the cause of the failure3. customer_id,name,curr_balance will come properly for all dth operators. But other params differ from operator to operator. Given in the below table
Customize plan for mobile user API URL :-https://<url>/api/recharge/customPlans?partner_id=ACCOUNT_ID&trans_id=RANDOM_NU M&mobile=NUMBER&operator=OP_CODEMethod :- GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :-ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)RANDOM_NUM : e.g. 52612 (Generate one random number and send it with request)NUMBER : e.g. 9182191923 (Mobile no of the user)OP_CODE : e.g. 4 (It is the operator code. Eg. 4 is code for Idea)Response Example :-c) Success{"status":"success",”jio_key”:”prime”,"data":{["price":129,"ofrtext":"Rs129=Unlimited call sabhi network par saath hi 1GB data aur 300 SMS, 28 din ke liye.","logdesc":"*RC129=Unlimited call, 1GB aur 300 SMS, 28 din."],["price":379,"ofrtext":"Rs379=Unlimited call sabhi network par saath hi 6GB data aur 900 SMS, 84 din ke liye.","logdesc":"#RC379=Unlimited call, 6GB aur 900 SMS, 84 din"]}d) Failure{"status":"failure",”errCode”:”E008”,"description":"Unable to fetch offers"}Notes :-1. Value of status can only be success/failure2. description contains the cause of the failure3. data contains array of all customer related offers (price, ofrtext, longdesc)4. This works only on below 4 operators (Airtel, Idea, Vodafone,Jio)5. Jio’s Prime/Non prime key will be available as well in the response of Jio operator
Plans APIURL :- https://<url>/api/recharge/oprPlansApi?partner_id=ACCOUNT_ID&trans_id=RANDOM_NU M&operator=OP_CODE&circle=CIRCLE_CODEMethod :- GET/POSTHeaders :-Authorization and Token: As mentioned in headers sectionInput Parameters :- ACCOUNT_ID : e.g. P0001234 (Account id of a merchant)RANDOM_NUM : e.g. 52612 (Generate one random number and send it with request)OP_CODE : e.g. 4 (It is the operator code. Eg. 4 is code for Idea)CIRCLE_CODE : e.g. AP (It is the circle code. Eg. AP is code for Andhra Pradesh. It will be empty in case of dth operators) Response Example :- e) Success{"status":"success","data":{"3G/4G":[{"plan_amt":"98","plan_validity":"28 days","plan_desc":"VOICE:NA +DATA:6 GB 4G/3G/2G Data +SMS:NA +TALKTIME:NA"}]}}f) Failure{"status":"failure",”errCode”:”E008”,"description":"No plans found"}Notes :-1. Value of status can only be success/failure2. description contains the cause of the failure3. data contains an array of all plans found. Key is the plan_type which is ‘3G/4G’ in this example4. Please find below list of circle codes & opr codes
Authorization params in Headers or in request params :-key and secret will be generated for each Merchant.Add following headers in each and every request,Authorization:Basic <key>Token:<encrypted string created using json string of request params and shared secret>To generate Token value, datastring will be generated by converting all input params in thejson string as follows,e.g. jsonstring = {"key1":"value1","key2":"value2"}# PHP encryption code<?php$encryption_key = "secret string";$encryption_key = substr(hash("sha256", $encryption_key, true), 0, 32);// json string data of request parameters$data = "json params string";// fixed iv string$iv = "0000000000000000";$encrypted = openssl_encrypt($data, "aes-256-cbc", $encryption_key, 0, $iv);?># Python encryption codefrom Crypto.Cipher import AESfrom Crypto import Randomfrom Crypto.Hash import SHA256# key : "secret key"# plaintext : "json params string"def encryptAES(key, plaintext): try: key = key.encode("utf8") key = SHA256.new(key).digest() iv = "0000000000000000".encode("utf8") plaintext = plaintext.encode("utf8") padding = AES.block_size - len(plaintext) % AES.block_size plaintext += bytes([padding]) * padding cipher = AES.new(key, AES.MODE_CBC, iv) data = cipher.encrypt(plaintext) return base64.b64encode(data) except Exception as e: # handel exception# Javascript encryption code with CryptoJSfunction encryption(msg) { let iv = CryptoJS.enc.Utf8.parse("0000000000000000"); let key = CryptoJS.SHA256(`<secret key>`); var obj = JSON.stringify(msg); var encrypted = CryptoJS.AES.encrypt(obj, key, { iv: iv, padding: CryptoJS.pad.Pkcs7, mode: CryptoJS.mode.CBC }); var enc_text = encrypted.toString(); return enc_text;}