Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

CLOUDBASED PETROL STATION

ACCOUNTING AND INVENTORY SOFTWARE

API V 1.0

1. Push APIs

a. Authentication/Token ................................................................................................................... 3

2. Pull APIs
a. Credit Sale Report. ........................................................................................................................ 6
AUTHENTICATION

Codelab FMS uses the following authentication type

1. API Key (to get the access token username and password is required. Life of token is 30 days for Staging and24
hours for production)
2. All communication are in JSON
1. Login and Token generation

Purpose Returns Token with successful message


URL http://api.codelabkenya.net/V1/Login/auth?Ver=1.0
Method POST
Note Username and Password will be provided after the registration of Vendor.
When Login is successful, API Token will be generated which can be used in all APIuntil
the expiration i.e. 30 days from the date of generation for Staging and 24 Hours for
Production.
Example RAW curl --location --request POST 'http://api.codelabkenya.net/V1/Login/auth?Ver=1.0' \
format JSON --header 'Content-Type: application/json' \
--header 'Cookie: ASP.NET_SessionId=aixwnpvpwgsu0roytblnv4hb' \
--data-raw '{ "email":"admin@codelabkenya.net", "password":"Codelab2023@"
}'
Success {
Response "Valid": true,
"Description": "Success",
"Value": [
{
"LoginEmail_Idno": "76",
"User_Name": "Robert Mwaura",
"User_Idno": "1",
"Comp_Idno": "1",
"DB_Name": "PetroCODELAB",
"CompanyUser_Idno": "0",
"CompName": "Codelab Kenya",
"Owner_Name": "Robert Mwaura",
"Owner_MobileNo": "4723210161",
"CompStateIdno": "2007",
"Class": "Admin",
"Department_Class": "Admin",
"Mobile_Token": "",
"Production_Token":
"U94Dfj5BiRVlSXEf7BTKZhV1TYdBBNA1mFX7e6qYVGSPJDgWXGfhIYnYUTLqG09vno5gKP
hRPrBMSIZG3Zg6sJs2ZFMbqdDEl76bkYRzMJi3iwQ1SaFTOaFGgTzlcMx7K9BCCNrzAqLAqz
ia1X0GooD0fQUCKLwUOFhlA8yMYfAQfkWywdWLen602PmLajSXUJTnJufoTb77HLp3hLx
uwrdoMEzcjaXksox94ejfI0J0tZKaRxA4esuSuKwcpAwZPsuesGcTxOUbwRa7Nxn64eav0fxs
0el4NJxfYjgYB3HudODC0magtEtMl5j17WJJjbE7pbflglOtWxbVfQbAY97m7PnjcP980aPdP
uA1WpgKHQfvLjoQBPiYaR4osrvuELOx10eOWQ8kQ2EUN7LB0zTZz3mPlYMk8A1hAemtC
YPdekhQXtIeYGlY8YSsbCpJXsGhNxvwrORafBuygXuqLlSUSTAG1Qp1RfCScRVx9Mq6CVW
ONyjm",
"Staging_Token": ""
}
],
"CompMast": [
{
"ID": "1",
"Name": "Codelab Kenya",
"Adress1": "68292-00200",
"Adress2": "NAIROBI",
"State_Idno": "2007",
"City_Idno": "25507",
"Pin_Code": "200",
"PanCard_No": "",
"TIN_No": "",
"LST_No": "",
"Phone_Off": "",
"Phone_Res": "",
"Mail": "admin@codelabkenya.net",
"Fax": "",
"Dlr_Code": "",
"Comp_Jurs": "",
"UserName": "",
"Password": "",
"Sender": "",
"Sms_Type": "0",
"Profile_Id": "",
"RPPL_No": "",
"Auth_Typ": "0",
"Auth_Key": "",
"GSTIN_No": "24026656",
"Owner_Name": "Robert Mwaura",
"Owner_MobileNo": "4723210161",
"Owner_Email": "",
"ContactPerson_Name": "",
"Contact_MobileNo": "",
"Contact_Email": "",
"CompReg_Idno": "66",
"OilComp_Idno": "7",
"Country_Idno": "113",
"DB_Name": "PetroCODELAB",
"stateName": "Nairobi",
"cityName": "",
"Tax_Type": "2",
"CIN_No": "",
"Comp_Logo": "~/img/profil-picture-default.jpg",
"CompReg_Idno1": "66",
"OilComp_Idno1": "7",
"Company_Name": "Codelab Kenya",
"Owner_Name1": "Robert Mwaura",
"Owner_MobileNo1": "0723210161",
"Contact_MobileNo1": "0",
"STD_Code": "0",
"ISD_Code": "0",
"Phone_No": "0",
"Address_1": "68292-00200",
"Address_2": "Nairobi",
"Country_Idno1": "113",
"State_Idno1": "2007",
"City_Idno1": "25507",
"GSTIN_No1": "24026656",
"TAN_No": "",
"PIN_Code1": "200",
"Comp_Email": "admin@codelabkenya.net",
"Registration_No": "",
"Plan_Idno": "1",
"Is_Active": "True",
"Warranty_Date": "12/31/2023 12:00:00 AM",
"RegDoc_Path": "CODELAB_Jellyfish.jpg",
"Is_Agree": "True",
"Is_App": "Web",
"OilComp_Name": "Codelab",
"OilComp_Logo": "Logo/Shell.png"
}
]
}
Response Invalid {
Email/Password "Valid": false,
"Description": "Invalid Username or Password.", "Value": []
}

2. Credit Sale Information

Purpose Returns Credit Sale Information


URL http://api.codelabkenya.net/V1/Reports/csr?Ver=1.0
Method Post
Param.Type Raw
Authorization API key in Header. Possible value “Token <Token generated while login>”
Data “Daily Job Data”
- “Ver” – version of API i.e. 1.0 mandatory
- “startdate” – From Date (string dd-MM-yyyy format) mandatory
- “enddate” – To Date (string dd-MM-yyyy format) mandatory
- “username” – Username (string length upto 20) mandatory
Note Username and Token generated or provided by Codelab are mandatory
Example Raw curl --location --request POST 'http://api. codelabkenya.net /V1/Reports/csr?Ver=1.0' \
format JSON --header 'Authorization: Token
9T9LZSFzoMuYb2P1KuDWcUs6kv2PRxsmPH23Vlo6yRXfnYIRZtAFPrnBqE6ocY3i6XzOBa7
WrVXspwSCKfZZkuNEC6w56bWyEE4WJR5dfxok41wN9dIra9E9CagFt3mBncFGuDzCyXJ4
DoQC52IpPIvkCbKBvFmmKIzV7y5dnOSFfS0ZAJwkGnjgZmbekyNoTgfPGsD2L2pH2fSPiCrK
b0QSzVWaO7NkHeYSId7glLj0eftKWJau33W5ZqjgSnC05ySoVzYThGgbYaXPlPl8afwcuwbJ
cZNPIdrfboG15MzJWgByE2RYwA6iNwKHlYbxDosDcjgzgLIb79ZRuSUQEBxIcXxKpcUAXYPz
TzeoWAeDybdKZtlmuezhSrUP627Nc5su3ecxegVznz7x5hGodXnoM8b4IYcgNR6G35jAMb
hVKPqTofy5ZlzjH8mL2TpUu9kp3gTEidPGQKrQPEeK3ohrsXnngi6mL1FEdi0lhI26hY8h2y4x
'\
--header 'Content-Type: application/json' \
--header 'Cookie: ASP.NET_SessionId=aixwnpvpwgsu0roytblnv4hb' \
--data-raw '{ "startdate":"01-04-2022",
"enddate":"31-07-2022", "username":"admin@codelabkenya.net"
}'
Success response {
"Valid": true,
"Description": "Credit Sale Report",
"Value": [
{
"SrNo": "1",
"Date": "01-05-2023",
"Memo No": "1",
"Ref No": "CK TEST",
"Party Name": "Codelab",
"Group Name": "Sundry Debtors",
"Sub Group Name": "Sundry Debtors",
"GSTIN": "",
"Vehicle No": "KBX 921E ",
"Item Name": "Petrol",
"UOM": "Ltrs",
"Item Qty": "45",
"Item Rate": "189",
"Disc_Type": "Value",
"Disc Value": "0",
"DiscAmnt": "0.00",
"Taxable Amount": "8,505.00",
"GSTPer": "0",
"SGST_Per": "0",
"SGSTAmnt": "0.00",
"CGST_Per": "0",
"CGSTAmnt": "0.00",
"IGST_Per": "0",
"IGSTAmnt": "0.00",
"Total Amount": "8,505.00",
"GST Type": "O",
"ItemAmount": "8,505.00",
"SaleType": "Credit",
"State": "Nairobi",
"Mobile_No": "",
"Read_No": "1",
"Salesman": "Naserian",
"Status": "UnFreezed",
"Cash_Pmt": "0.00",
"HSN": "",
"CompCode": "CODELAB",
"Location": "Codelab Petrol Station"
},
{
"SrNo": "2",
"Date": "01-05-2023",
"Memo No": "2",
"Ref No": "",
"Party Name": "Salman",
"Group Name": "Sundry Debtors",
"Sub Group Name": "Sundry Debtors",
"GSTIN": "",
"Vehicle No": "",
"Item Name": "Petrol",
"UOM": "Ltrs",
"Item Qty": "30",
"Item Rate": "189",
"Disc_Type": "Value",
"Disc Value": "0",
"DiscAmnt": "0.00",
"Taxable Amount": "5,670.00",
"GSTPer": "0",
"SGST_Per": "0",
"SGSTAmnt": "0.00",
"CGST_Per": "0",
"CGSTAmnt": "0.00",
"IGST_Per": "0",
"IGSTAmnt": "0.00",
"Total Amount": "5,670.00",
"GST Type": "O",
"ItemAmount": "5,670.00",
"SaleType": "Credit",
"State": "Nairobi",
"Mobile_No": "",
"Read_No": "1",
"Salesman": "Naserian",
"Status": "UnFreezed",
"Cash_Pmt": "0.00",
"HSN": "",
"CompCode": "CODELAB",
"Location": "Codelab Petrol Station"
},
{
"SrNo": "999999",
"Date": "",
"Memo No": "",
"Ref No": "",
"Party Name": "",
"Group Name": "",
"Sub Group Name": "",
"GSTIN": "",
"Vehicle No": "",
"Item Name": "Grand Total",
"UOM": "",
"Item Qty": "75",
"Item Rate": "0",
"Disc_Type": "",
"Disc Value": "0",
"DiscAmnt": "0.00",
"Taxable Amount": "14175.00",
"GSTPer": "",
"SGST_Per": "",
"SGSTAmnt": "0.00",
"CGST_Per": "",
"CGSTAmnt": "0.00",
"IGST_Per": "",
"IGSTAmnt": "0.00",
"Total Amount": "14175.00",
"GST Type": "O",
"ItemAmount": "14175.00",
"SaleType": "",
"State": "",
"Mobile_No": "",
"Read_No": "0",
"Salesman": "",
"Status": "",
"Cash_Pmt": "0.00",
"HSN": "",
"CompCode": "",
"Location": ""
}
]
}
Response error {
"Valid": false,
"Description": "No Result Found.", "Value": []
}

You might also like