Our API is a REST API (Representational State Transfer) which returns the Data as a JSON Format. This API is a two-way process of fetching as well as posting the data. With the help of this plan, the customers/parties will be able to view the data of Current Stock, Invoice for Orders received, and dispatch the order also. They can view masters, insert order of new product, and can dispatch their order.
MobileAppSolution plan consists of 3 API’s:
This API is basically for those customers who need a compact solution. This service/feature can be used for Master Sync. For example: Party/Customer, Product, User Master, Rate updation etc. In this API
we will provide the following Masters:
URL: https://wservices.margcompusoft.com/api/eOnlineData/MargMST2017
API URL |
https://wservices.margcompusoft.com/api/eOnlineData/MargMST2017 |
Interface/API Name |
MargMST2017 |
Json Input |
{ "CompanyCode": "", "MargID": "", "Datetime": "", "Index": "" } |
Request Type |
POST |
Content Type |
Application Json |
Interface Description |
This service/feature is used For Master Sync. For example Customer, Product, User Master, Rate updation etc. |
Field Name | Data Type | Sample Value | Remark |
---|---|---|---|
CompanyCode | String | MARGLIVE | MARGLIVE |
MargID | Integer | 8835 | MARGID (Provided by Margerp) |
Datetime | Date Time (Json Format) | If DateTimepass blank then API return ALL Data.Other wise provide incremental data. Datetime format – (2017-01-14 13:53:20) | |
index | Integer | 0 | Defult 0 |
{
"CompanyCode": "VIKRAMNEGI2",
"MargID": "314539",
"Datetime": "",
"index": "0"
}
Json Object name | Field name | Data Type | Length/Decimal | Sample Value | Remark | |||||
---|---|---|---|---|---|---|---|---|---|---|
Pro_N | Rid | Integer | 9 | 20170110 | Row ID | |||||
" " | CatCode | Varchar | 6 | Z1 | Item Category Code | |||||
" " | Code | Varchar | 22 | 1000005 | Item Code | |||||
" " | Name | Varchar | 45 | BETNSOL INJ. | Item Name | |||||
" " | Stock | Numeric | 15,3 | 1.00 | Current Stock | |||||
" " | Remark | Varchar | 200 | |||||||
" " | Company | String | 40 | Cadila Pharma | Name of Product Company | |||||
" " | ShopCode | |||||||||
" " | MRP | Numeric | 10,2 | 0.00 | Maximum Retail Price | |||||
" " | Rate | Numeric | 10,2 | 0.00 | Billing Price | |||||
" " | Deal | Numeric | 5 | 10 | Deal on (10 if Deal is 10+1) | |||||
" " | Free | Numeric | 5 | 1 | Free Qty(1 deal is 10+1) | |||||
" " | PRate | Numeric | 10,2 | 0.00 | Purchase Price | |||||
" " | Is_Deleted | Integer | 6 | 0 or 1 | If product is deleted or not 0=Not Deleted, 1=Deleted | |||||
" " | CurBatch | Varchar | 12 | ABC0002 | Current Running batch of the item | |||||
" " | Exp | Varchar | 20 | 20/03/2015 | Expiry Date of current batch | |||||
" " | GCode | Varchar | 6 | CP002 | Product Company Code | |||||
" " | MargCode | Varchar | 200 | |||||||
" " | Conversion | Varchar | 200 | 15 | Item conversion | |||||
" " | Salt | Varchar | 6 | "A" | Salt code | |||||
" " | ENCODE | Varchar | 25 | " " | Barcode | |||||
" " | Remarks | Varchar | Remarks information | |||||||
" " | Gcode6 | Varchar | SJU | HSN code (internal code) | ||||||
" " | ProductCode | |||||||||
Pro_U | Rid | Integer | 9 | 20170110 | Row ID (It will Return when Pass Date & Time) | |||||
" " | CatCode | Varchar | 6 | Z1 | Item Category Code | |||||
" " | Code | Varchar | 22 | 1000005 | Item Code | |||||
" " | Name | Varchar | 45 | BETNSOL INJ. | Item Name | |||||
" " | Stock | Numeric | 15,3 | 1.00 | Current Stock | |||||
" " | Remark | Varchar | 200 | |||||||
" " | Company | String | 40 | Cadila Pharma | Name of Product Company | |||||
" " | ShopCode | |||||||||
" " | MRP | Numeric | 10,2 | 0.00 | Maximum Retail Price | |||||
" " | Rate | Numeric | 10,2 | 0.00 | Billing Price | |||||
" " | Deal | Numeric | 5 | 10 | Deal on (10 if Deal is 10+1) | |||||
" " | Free | Numeric | 5 | 1 | Free Qty(1 deal is 10+1) | |||||
" " | PRate | Numeric | 10,2 | 0.00 | Purchase Price | |||||
" " | Is_Deleted | Integer | 6 | 0 or 1 | If product is deleted or not 0=Not Deleted, 1=Deleted | |||||
" " | CurBatch | Varchar | 12 | ABC0002 | Current Running batch of the item | |||||
" " | Exp | Varchar | 20 | 20/03/2015 | Expiry Date of current batch | |||||
" " | GCode | Varchar | 6 | CP002 | Product Company Code | |||||
" " | MargCode | Varchar | 200 | |||||||
" " | Conversion | Varchar | 200 | 15 | Item conversion | |||||
" " | Salt | Varchar | 6 | "A" | Salt Code | |||||
" " | ENCODE | Varchar | 25 | "" | Barcode | |||||
" " | Remarks | Varchar | Remarks information | |||||||
" " | Gcode6 | Varchar | SJU | HSN code (internal code) | ||||||
" " | ProductCode | |||||||||
Pro_S | Code | Varchar | 22 | 124 | Item internal Code (It will Return when Pass Date & Time) | |||||
" " | Stock | Varchar | 15,3 | "0" | item stock Qty | |||||
" " | ProductCode | |||||||||
Pro_R | Code | Varchar | 22 | 124 | Item internal Code (It will Return when Pass Date & Time) | |||||
" " | Stock | Numeric | 0.00 | Item Stock Qty | ||||||
" " | MRP | Numeric | 10,2 | 0.00 | MRP Rate | |||||
" " | Rate | Numeric | 10,2 | "1.66" | Sale rate | |||||
" " | Deal | Varchar | 5 | "0" | Deal Qty | |||||
" " | Free | Varchar | 5 | "0" | Free Qty | |||||
" " | PRate | Numeric | 10,2 | 0.00 | Purchase rate | |||||
" " | ProductCode | |||||||||
" " | Curbatch | Varchar | "BFE456" | Current Batch (FIFO base) | ||||||
Stype | Rid | Integer | 6 | 85344 | Row ID(Identity) | |||||
" " | Sgcode | Varchar | 6 | "AREA" | Sub Master Code,,, For Company 'AREA' for Category CATEGO','.'ROUT' | |||||
" " | Scode | Varchar | 6 | "A9" | Sub Master Code | |||||
" " | Name | String | 45 | CADILA PHARMA | Name of Group/area/company/route | |||||
" " | Is_Deleted | Integer | 0 | 0=not deleted ,1=deleted | ||||||
Party | Rid | Integer | 186999 | Row ID ( Identity) | ||||||
" " | Area | String | 6 | " " | Area Code | |||||
" " | Code | String | 6 | CREDIT | Party Code | |||||
" " | Address | String | 150 | " " | Party Address | |||||
" " | Name | String | 45 | CREDIT CARD | Party Name | |||||
" " | Balance | Numeric | 14,2 | 0.00 | Current Party Balance | |||||
" " | Pdc | Numeric | 14,2 | 0.00 | PDC amount of party | |||||
" " | Gcode | String | 6 | C6 | Ledger Type ( Group Debtor, creditor, sales man etc) | |||||
" " | Opening | Numeric | 14,2 | 0.00 | Party Opening as on start of the financial year | |||||
" " | Is_Deleted | Integer | 0 | 1=deleted , 0 = not deleted | ||||||
" " | Phone1 | String | 12 | 8527812345 | phone number-1 | |||||
" " | Phone2 | String | 12 | 8527812345 | phone number-2 | |||||
" " | Phone3 | String | 12 | 8527812345 | phone number-3 | |||||
" " | Phone4 | String | 12 | 8527812345 | phone number-4 | |||||
" " | String | 45 | test1@gmail.com | Email ID-1 | ||||||
" " | Emai2 | String | 45 | test1@gmail.com | Email ID-2 | |||||
" " | Email3 | String | 45 | test1@gmail.com | Email ID-3 | |||||
" " | Bank | String | 45 | " " | Bank Name For Payment | |||||
" " | Branch | String | 45 | " " | Bank Branch Name | |||||
" " | MargCode | String | 20 | " " | ||||||
" " | GSTIN | String | 15 | " " | ||||||
" " | DlNo. | String | 45 | " " | ||||||
" " | LedgerCode | |||||||||
Users | RowID | Integer | 12361 | Row ID ( Identity) | ||||||
" " | UserID | String | 50 | PNC | User ID | |||||
" " | Name | String | 100 | PNC | User Name | |||||
" " | Address1 | String | 60 | F-11 Roshanara Plaza, | User Address-1 | |||||
" " | Address2 | String | 60 | Roshanara Road, | User Address-2 | |||||
" " | Address3 | String | 60 | Delhi | User Address-3 | |||||
" " | Phone | String | 25 | 011 30969600 | User Phone | |||||
" " | Mobile | String | 25 | 9329203638 | User Mobile | |||||
" " | String | 50 | test@gmail.com | User Email ID | ||||||
" " | Is_Deleted | Integer | 0 | 1=deleted , 0 = not deleted | ||||||
" " | Type | String | 1 | S | User Type (S-salesman) | |||||
Index | Integer | 500000 | ||||||||
DataStatus | String | 10 | Completed | |||||||
DataStatus | String | 10 | Completed | |||||||
Status | String | 10 | Success | Message | ||||||
DateTime | Date & TIme | 26 | 2017-01-14 13:53:20 | API Returns Date & Time.(it will use for next time) |
{
"Details": {
"pro_N": [
{
"rid": "31579023",
"catcode": "SFB ",
"code": "1010049",
"name": "ITEM CATEGORY",
"stock": "0.000",
"remark": "",
"company": "COMPANY ABC",
"shopcode": "",
"MRP": "0.00",
"Rate": "0.00",
"Deal": "0",
"Free": "0",
"PRate": "0.00",
"Is_Deleted": "0",
"curbatch": "",
"exp": " ",
"gcode": "FE ",
"MargCode": "",
"Conversion": "0",
"Salt": "SFB",
"ENCODE": "",
"remarks": "P;9;2; ;1;;;;;;PCS ;;;0;9;;;",
"Gcode6": null,
"ProductCode": ""
}
],
"pro_U": [
{
"rid": "31579023",
"catcode": "SFB ",
"code": "1010049",
"name": "ITEM CATEGORY",
"stock": "0.000",
"remark": "",
"company": "COMPANY ABC",
"shopcode": "",
"MRP": "0.00",
"Rate": "0.00",
"Deal": "0",
"Free": "0",
"PRate": "0.00",
"Is_Deleted": "0",
"curbatch": "",
"exp": " ",
"gcode": "FE ",
"MargCode": "",
"Conversion": "0",
"Salt": "SFB",
"ENCODE": "",
"remarks": "P;9;2; ;1;;;;;;PCS ;;;0;9;;;",
"Gcode6": null,
"ProductCode": ""
}
],
"pro_S": [
{
"code": "1010045",
"stock": "27.000",
"ProductCode": ""
}
],
"pro_R": [
{
"code": "1010019",
"stock": "0.000",
"MRP": "300.00",
"Rate": "220.00",
"Deal": "0",
"Free": "0",
"PRate": "200.00",
"ProductCode": "",
"Curbatch": ""
}
],
"Stype": [
{
"rid": "3704087",
"sgcode": "CATEGO",
"scode": "SFB ",
"name": "CETEGORY",
"Is_Deleted": "0"
}
],
"Party": [
{
"rid": "4790934",
"area": " ",
"code": "KJ ",
"address": "",
"name": "B",
"balance": "600.00",
"pdc": "0.00",
"gcode": "C6 ",
"opening": "0.00",
"Is_Deleted": "0",
"phone1": "",
"phone2": " ",
"phone3": " ",
"phone4": " ",
"email1": "",
"email2": "",
"email3": "",
"bank": "",
"branch": "",
"MargCode": "0000 ",
"GSTIN": "",
"DlNo": "",
"LedgerCode": ""
}
],
"Users": [
{
"RowID": "171339",
"UserID": "SALES",
"Name": "SALESMAN",
"Address1": "",
"Address2": "",
"Address3": "",
"Phone": "",
"Mobile": "",
"Email": "",
"Is_Deleted": "0",
"Type": "S"
}
],
"Index": "500000",
"Datastatus": "Completed",
"Status": "Sucess",
"DateTime": "2022-03-25 16:07:44"
}
}
With the help of this API we can insert order in ERP. This API is used for B2B Transactions.
URL: https://wservices.margcompusoft.com/api/eOnlineData/InsertOrderDetail
API URL |
https://wservices.margcompusoft.com/api/eOnlineData/InsertOrderDetail |
Interface/API Name |
InsertOrderDetail |
Json Input |
{ "OrderID":"", "OrderNo": “989876", "CustomerID": "4159212", "MargID": "314539", "Type": "S", "Sid": "171339", "ProductCode": "1000001,1000004", "Quantity": "4,5", "Free": "0,0", "Lat": "", "Lng": "", "Address": "", "GpsID": "0", "UserType": "1", "Points": "0.0", "Discounts": "0", "Transport": "", "Delivery": "", "Bankname": "", "BankAdd1": "", "BankAdd2": "", "shipname": "", "shipAdd1": "", "shipAdd2": "", "shipAdd3": "", "paymentmode": "1", "paymentmodeAmount": "0", "payment_remarks": "", "order_remarks": “Order remark", "CustMobile": "", "CompanyCode": "VIKRAMNEGI2", "OrderFrom": "VIKRAMNEGI2" } |
Request Type |
POST |
Content Type |
Application Json |
Interface Description |
Use it for B2B Order insert in ERP |
Field Name | Data Type | Sample Value | Remark | |||
---|---|---|---|---|---|---|
OrderId | Integer | Pass blank | ||||
OrderNo. | Integer | 989876 | Pass your order no (which is maintain by your app or web) | |||
CustomerID | Integer | 4159212 | Pass Customer Row ID | |||
Margid | Integer | 314539 | e-Business ID From Marg | |||
Type | String | S | Pass Default Value S (S:Salesman) | |||
Sid | Integer | 171339 | Pass salesman Row ID | |||
ProductCode | Integer | 1000001 | Pass Item Code (if multiple use comma array) | |||
Quantity | Numeric | 10 | Pass Order Item Quantity (if multiple use comma array) | |||
Free | Numeric | 0 | Pass Free Item Quantity (Default Value 0) (if multiple use comma array) | |||
Lat | String | “ “ | It’s Not mandatory field, (If want pass latitude of Address, please pass Here) | |||
Lng | String | " " | It’s Not mandatory field, (If want pass longitude of Address, please pass Here) | |||
Address | String | " " | It’s Not mandatory field (If want pass Order Punching Address, Pass here) | |||
GpsID | Integer | 0 | It’s Not mandatory field (Default Value 0) | |||
UserType | Integer | 1 | It’s mandatory field (Default Value 1) | |||
Points | Numeric | 0.00 | It’s Not mandatory field (Default Value 0.00) | |||
Discounts | Numeric | 0.00 | It’s Not mandatory field (Default Value 0.00) | |||
Transport | String | Blank | It’s Not mandatory field (Default Value Blank) | |||
Delivery | String | It’s Not mandatory field (Default Value 0.00) | ||||
BankName | String | " " | It’s Not mandatory field (Default Value Blank) | |||
BankAdd1 | String | " " | It’s Not mandatory field (Default Value Blank) | |||
BankAdd2 | String | " " | It’s Not mandatory field (Default Value Blank) | |||
ShipName | String | " " | It’s Not mandatory field (Default Value Blank) | |||
ShipAdd1 | String | " " | It’s Not mandatory field (Default Value Blank) | |||
ShipAdd2 | String | " " | It’s Not mandatory field (Default Value Blank) | |||
ShipAdd3 | String | " " | It’s Not mandatory field (Default Value Blank) | |||
PaymentMode | Integer | " " | (Default Value 1) | |||
PaymentmodeAmount | Numeric | " " | (Default Value 0) | |||
Payment_remarks | String | " " | " " | |||
Order_remarks | String | " " | " " | |||
CustMobile | String | 1 | It’s Not mandatory field (Default Value Blank) | |||
CompanyCode | String | VIKRAMNEGI2 | Company code provided by Marg Erp | |||
OrderFrom | String | VIKRAMNEGI2 | Company code provided by Marg Erp |
{
"OrderID":"",
"OrderNo": "656565",
"CustomerID": "4159212",
"MargID": "314539",
"Type": "S",
"Sid": "171339",
"ProductCode": "1000001, 1000004",
"Quantity": "4, 5",
"Free": "0, 0",
"Lat": "",
"Lng": "",
"Address": "",
"GpsID": "0",
"UserType": "1",
"Points": "0.0",
"Discounts": "0",
"Transport": "",
"Delivery": "",
"Bankname": "",
"BankAdd1": "",
"BankAdd2": "",
"shipname": "",
"shipAdd1": "",
"shipAdd2": "",
"shipAdd3": "",
"Paymentmode": "1",
"PaymentmodeAmount": "0",
"payment_remarks": "",
"order_remarks": "ORDERREMARKNEW",
"CustMobile": "",
"CompanyCode": "VIKRAMNEGI2",
"OrderFrom": "VIKRAMNEGI2"
}
Json Object name | Field name | Data Type | Length/Decimal | Sample Value | Remark | |||||
---|---|---|---|---|---|---|---|---|---|---|
Order Details | OrderId | Integer | 0 | Your order no. which is maintain by your app or website | ||||||
" " | OrderNo | Integer | 77604 | Marg unique order Id which shows in Marg ERP also | ||||||
CustomerID | N/A | Integer | 77604 | customer Row Id | ||||||
UserID | - | - | - | - | N/A | |||||
Name | - | - | - | - | N/A | |||||
PCode | - | String | - | HLZ | Customer code (internal) | |||||
Status | String | 10 | Success | Message | ||||||
Message | - | String | 26 | Record updated successfully | Record updated successfully |
{
"Details": {
"OrderDetails": [
{
"OrderID": "0",
"OrderNo": "1081271"
}
],
"CustomerID": "5396829",
"UserID": "",
"Name": "",
"PCode": "HLZ ",
"Status": "Success",
"Message": "Record Inserted Successfully"
}
}
LiveOrderDispatchStatus API allows to dispatch all those orders which are being inserted Through this API, the customers/party receives the invoice of only those orders which are being inserted through masters.
URL: https://wservices.margcompusoft.com/api/eOnlineData/LiveOrderDispatchStatus2017
API URL |
https://wservices.margcompusoft.com/api/eOnlineData/LiveOrderDispatchStatus2017 |
Interface/API Name |
LiveOrderDispatchStatus2017 |
Json Input |
{ "CompanyCode": "", "MargID": "", "SalesmanID": "", "Type": "", "Datetime": "", "index": "" } |
Request Type |
POST |
Content Type |
Application Json |
Interface Description |
This Service/Feature is used For Master Sync. For example Customer, Product Company, User Master etc. (It will Return All Data). |
Field Name | Data Type | Sample Value | Remark |
---|---|---|---|
CompanyCode | String | MARGLIVE | MARGLIVE |
MargID | Integer | 8835 | e-Business ID From Marg |
SalesmanID | String | 001 | Pass salesman userId |
Type | String | S | Vouchar Type |
Datetime | Date & If Date Column is blank in that case API return ALL Time | If Date Column is blank in that case API return ALL Data. | |
index | Integer | 0 |
{
"CompanyCode": "MARGLIVE",
"MargID": "8835",
"SalesmanID": "001",
"Type": "S",
"Datetime": "",
"index": "0"
}
Json Object name | Field name | Data Type | Length/Decimal | Sample Value | Remark | |||||
---|---|---|---|---|---|---|---|---|---|---|
Order Main | Rid | Integer | 123 | Row ID(Identity) | ||||||
" " | Amount | Numeric | 12,3 | 279.00 | Bill Value | |||||
" " | Code | String | 12 | #10 | Product Code | |||||
" " | CompanyId | Integer | 8835 | This is company Id | ||||||
" " | Dt | Date | 12 | 2016-12-28 | It’s Bill Date | |||||
" " | Varchar | 200 | BH-321 | General Remark (combination of MRP, Rate, Schemes, etc.. ..Not mandatory) | ||||||
" " | Profit | Numeric | 12,3 | It’s not mandatory field (Default value blank) and its use for goods delivery address purpose | ||||||
" " | Smccode | String | 9 | A106 | It’s salesman code | |||||
" " | Vcn | String | 12 | 0000100 | It’s Bill No | |||||
" " | Vouchar | String | 12 | 3164 | It's internal Vouchar No. | |||||
" " | Shopcode | String | 20 | |||||||
" " | Area | String | 6 | A12 | It’s Area code of customer | |||||
" " | OrderNo | String | 12 | LVO-25063 | It’s order No. | |||||
" " | Billfmt | N/A | N/A | N/A | We will share another document for bill format | |||||
" " | Salesmemo | String | 250 | ,0,,,,,,2018-01-19,0,,BANK OF BARODA,,,,,,,PNC,,,,S,,PNC, | It’s bill printing format | |||||
" " | Name | String | 35 | NARALA PHARMA | Party Name | |||||
OrderInfo | RID | Integer | 1 | Row ID | ||||||
" " | Vouchar | String | 12 | 3164 | Vouchar No. | |||||
" " | OrderId | String | 12 | 25063 | It’s order unique ID | |||||
" " | DateSub | Date & Time | 26 | 2016-12-28 14:40:03 | Place order date | |||||
" " | Dateisu | Date & Time | 26 | 2016-12-28 14:47:18 | Bill generated Date | |||||
" " | Datedis | N/A | N/A | N/A | Dispatch Date | |||||
Index | Integer | 0 | ||||||||
DataStatus | Completed | |||||||||
Status | Success | String | 10 | Success | Message | |||||
DateTime | 2017-02-24 | Date & Time | 26 | 2017-02-24 12:32:59 | Date & Time |
{
"Details": {
"OrderMain": [
{
"rid": 1,
"Amount": "246.00",
"code": "#7",
"companyid": "8835",
"dt": "2018-01-19",
"profit": "",
"smccode": "A106",
"vcn": "0000100",
"voucher": "406408",
"shopcode": "",
"area": "A12 ",
"OrderNo": "LVO-278718;278721",
"Billfmt": "H,1,0000100,19012018,LVO-278718;278721,00000000,BANK OF BARODA,1,,19012018,,,19012018,07-DELHI,0,0\rT,$90,ELDER INDIA,EIELT101,,ELDOFLAM TB,1*15T,,,00000000,1,1,5,0,12.12,0.00,0,1,0,,15,0,6,10.91,0,170.89,8.54,MARG123,\rT,$90 ,ELDER INDIA,EIEP1101,,EPRIN 150,10T,,,00000000,1,1,5,0,1.66,0.00,0,1,0,,10,0,6,1,0,15.60,0.78,MARG124,\rF,246,11.91,",
"Salesmemo": ",0,,,,,,2018-01-19,0,,BANK OF BARODA,,,,,,,PNC,,,,S,,PNC,",
"Name": "AHUJA MEDICINE CENTRE"
},
]"OrderInfo": [
{
"rid": 1,
"voucher": "406408",
"OrderID": "278718",
"datesub": "2018-01-19 15:20:32",
"dateisu": "2018-01-19 15:19:26",
"datedis": ""
},
],
"Index": "2000",
"Datastatus": "Completed",
"Status": "Sucess",
"Datetime": "2018-09-12 16:59:17"
}
}