Get Purchase Vouchers
Returns your purchase vouchers (supplier bills entered as purchases) from Logic ERP, each with its header (supplier, bill number and date, amounts, transport, gate pass) and its item lines (item, lot, quantity, rate, discounts, charges, taxes and physical-verification quantities). Use it to copy new and changed purchases into your own system — normally by asking only for vouchers added or changed since your last call — or to fetch particular vouchers by their internal number.
Purchase returns, purchase challans, purchase challan returns and stock transfers in are not returned here; they have their own endpoints with the same response layout: Get Purchase Returns, Get Purchase Challans, Get Purchase Challan Returns and Get Stock Transfers In.
Endpoint
Address
https://your-server/api/GetPurchaseVoucher
Method
POST
Authorization
Basic Auth
The response and the common request fields are explained in How Every API Call Works.
Request fields
GlobalModifyCode
number
No
0
Your bookmark in the change log, as described in How Every API Call Works: 0 = from the start (or a period, with DateFrom/DateTo), a number = only changes after it, -1 = Logic ERP keeps the bookmark for you.
DateFrom, DateTo
date
No
empty
With GlobalModifyCode 0: a period of changes (the date a voucher was saved or edited, not the voucher date). Send both as null when you are not asking for a period. Also decides the financial year that is searched – see the rules. Write them as yyyy-MM-dd.
Doc_Codes
text
No
empty
Logic ERP's internal voucher numbers (Vouch_Code in the response), separated by commas, for example "52,53". Returns exactly these vouchers; the bookmark and period are ignored. Numbers and commas only.
Branch_Codes_From
text
No
empty
Branch codes separated by commas, for example "2,5". Only vouchers of these branches are returned, in every kind of request. Numbers and commas only.
Doc_Num_Like
text
No
empty
Only vouchers whose internal voucher number starts with this text. That number is PU followed by the voucher date as yyyyMMdd and a serial of the day, so "PU202604" gives vouchers dated April 2026. Stock transfers in also start with PU. Used with the bookmark or a period; ignored with Doc_Codes.
Field names are matched without regard to upper or lower case. Other fields in the request (for example PartyUserCode, ApprovalFilter, Branch_Codes_To) are ignored.
Rules Logic ERP applies
Only purchase vouchers. Purchase returns and stock transfers in are never returned here, even when they are in the change log or you name them in
Doc_Codes.One change log for several endpoints. Purchase vouchers, purchase returns and stock transfers in (and other documents kept with purchases, such as production receipts) share one change log. With a bookmark, each call reads up to 150 change-log lines of all these kinds and returns only the purchase vouchers among them, so a batch can hold few vouchers or none. When it holds none you get
"No Record Found."withStatus: trueand a higherLastGlobalModifyCode– store it and call again. You have caught up when the message is"No Purchase Voucher found..."andLastGlobalModifyCodeis the value you sent. If you also use Get Purchase Returns or Get Stock Transfers In, keep a separate bookmark for each endpoint.A voucher can come back in a later batch. Every save of a voucher adds a line to the change log, so a voucher edited after your bookmark is returned again with its current details. Update it in your system; do not add it a second time.
Your key for a voucher is
Vouch_Codetogether with its financial year.Vouch_Codestarts again every financial year, so two vouchers of different years can have the sameVouch_Code.Which financial year is searched. When
DateFromis a valid date, the financial year that containsDateFromis searched; otherwise the financial year the Logic ERP API site is currently working in. WithDoc_Codes,DateFromis used only for this: to fetch vouchers of an earlier year, send theirDoc_CodeswithDateFromandDateToinside that year (the dates do not filter the vouchers).With
"GlobalModifyCode": -1, only changes to vouchers of the current financial year are considered.Branch_Codes_Fromonly narrows what the rest of the request selects. With a bookmark it narrows the batch: vouchers of other branches are skipped and are not returned in a later batch either. In a period request it also narrows the change log.With
Doc_Codesor a period,LastGlobalModifyCodecomes back as0.Your Logic ERP team can limit this endpoint in the API site setup to certain branches and voucher series (GRN prefixes). Vouchers outside them are never returned, whatever you send – even a voucher you have just saved through the API, for example one billed against a purchase challan in another series.
Your Logic ERP team can also choose which fields are returned. A field that is not chosen is left out of the response altogether; the line fields
Pur_Txn_Code,ItemCode,Pur_MRP,Pur_Gross_Amt,Pur_Net_Amt,Pur_Round_Amt,Pur_Net_RateandGross_Pur_Amtare always returned. When no choice has been made – the usual case – every field below is returned.Every line must find its linked records in Logic ERP (item, lot, pack, colour, company, group, HSN, item description, tax rates) and the voucher its supplier (with the supplier's city, state and country), account-entry party, agent, branch, currency and tax region. A line that cannot is left out, and a voucher whose header links cannot be found is not returned. In normal use these records always exist.
Action_Codeis always empty.Vouchers are not returned in any guaranteed order.
Vouch_DateandBill_Dateare textdd/MM/yyyy.Gr_Date,Order_DateandGPN_Dateare text in the server's short date format, for example25/01/24. A date that is not filled is"".
Known issue – change-log lines of an earlier financial year. The change log holds lines of every financial year, but each line is read against the current year (with a bookmark, and also in a first sync from
0and in a period request). So when a voucher of an earlier financial year is edited, or an earlier year's line falls in your batch, that voucher is not returned; instead an unrelated voucher of the current year with the sameVouch_Codemay be returned, possibly one you already have. Check thatVouch_Datefalls in the financial year you expect before you store a record byVouch_Code, and fetch edited earlier-year vouchers withDoc_CodesplusDateFromandDateToinside that year.
Known issue – deleted vouchers are not reported. A voucher deleted in Logic ERP is simply no longer returned; no record marked as deleted is sent, so a deletion does not reach you through this endpoint (the same applies to Get Purchase Returns and Get Stock Transfers In). To find deletions, fetch the vouchers you hold by
Doc_Codesfrom time to time and remove those that no longer come back.
Known issue – lines repeated and a gate pass of another voucher. The gate pass is looked up by
Vouch_Codeand branch without the financial year. SoGPN_Number/GPN_Datecan belong to a voucher of another financial year that has the sameVouch_Codeand branch, and when several such vouchers have a gate pass, every line of the voucher is returned once for each of them. Keep only one line perPur_Txn_Code, rely on the headerQuantityand amounts, and check thatGPN_Dateis close toVouch_Datebefore you use the gate pass.
Example request
Next batch after your stored bookmark:
A voucher of an earlier financial year by its internal number:
Test it
Send a request to the Logic ERP sandbox (a test company) from this page: open the block below, enter the sandbox user name and password (ask your Logic ERP support team), change the request if you like, and press Test it. The example asks for the first batch of the change log; send the LastGlobalModifyCode you get back to see the next batch. Do not send "GlobalModifyCode": -1 here – it changes what the sandbox has marked as already sent.
Returns your purchase vouchers (supplier bills entered as purchases) from Logic ERP, each with its header (supplier, bill number and date, amounts, transport, gate pass) and its item lines (item, lot, quantity, rate, discounts, charges, taxes and physical-verification quantities). Use it to copy new and changed purchases into your own system — normally by asking only for vouchers added or changed since your last call — or to fetch particular vouchers by their internal number.
The user name and password of your API site.
Your bookmark in the change log, as described in How Every API Call Works: 0 = from the start (or a period, with DateFrom/DateTo), a number = only changes after it, -1 = Logic ERP keeps the bookmark for you.
With GlobalModifyCode 0: a period of changes (the date a voucher was saved or edited, not the voucher date). Send both as null when you are not asking for a period. Also decides the financial year that is searched – see the rules. Write them as yyyy-MM-dd.
With GlobalModifyCode 0: a period of changes (the date a voucher was saved or edited, not the voucher date). Send both as null when you are not asking for a period. Also decides the financial year that is searched – see the rules. Write them as yyyy-MM-dd.
Logic ERP's internal voucher numbers (Vouch_Code in the response), separated by commas, for example "52,53". Returns exactly these vouchers; the bookmark and period are ignored. Numbers and commas only.
Branch codes separated by commas, for example "2,5". Only vouchers of these branches are returned, in every kind of request. Numbers and commas only.
Only vouchers whose internal voucher number starts with this text. That number is PU followed by the voucher date as yyyyMMdd and a serial of the day, so "PU202604" gives vouchers dated April 2026. Stock transfers in also start with PU. Used with the bookmark or a period; ignored with Doc_Codes.
Always HTTP 200. Check Status, Message and GetData.
See the Status rules on this page and on How Every API Call Works.
Why the call failed, or a note. The reason may be followed by technical detail - read the first line.
The change-log bookmark (see How Every API Call Works).
Size of the answer, for example "2 KB".
No login was sent.
POST /api/GetPurchaseVoucher HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"GlobalModifyCode": 0,
"DateFrom": null,
"DateTo": null
}{
"GetData": [
{
"Vouch_Code": 1,
"Vouch_No": "text",
"Vouch_Date": "text",
"Account_Code": "text",
"Account_Name": "text",
"Agent_Name": "text",
"Quantity": 1,
"Gross_Amount": 1,
"Net_Amount": 1,
"Total_Tax": "text",
"Branch_Name": "text",
"Branch_Code": 1,
"Currency_Name": "text",
"Bill_No": "text",
"Bill_Date": "text",
"GRN_Prefix": "text",
"GRN_Number": 1,
"Tax_Region_Name": "text",
"Goods_In_Transit": 1,
"Action_Code": "text",
"Doc_Type_Desc": "text",
"Doc_Type": "text",
"Gr_Number": "text",
"Gr_Date": "text",
"Order_No": "text",
"Order_Date": "text",
"Header_Remarks_1": "text",
"Header_Remarks_2": "text",
"Header_Remarks_3": "text",
"Transport_Mode": "text",
"Transport_Name": "text",
"Trans_ID": "text",
"Trans_Services": "text",
"Weight": "text",
"Cases": "text",
"GPN_Number": "text",
"GPN_Date": "text",
"ListItems": [
{
"Pur_Txn_Code": 1,
"Lot_Code": 1,
"Lot_Number": "text",
"AddlItemCode": "text",
"ItemCode": "text",
"PackName": "text",
"CF_1": 1,
"CF_2": 1,
"CF_3": 1,
"Item_Sale_Rate": 1,
"Item_Sp_Rate_1": 1,
"Item_Sp_Rate_2": 1,
"Item_Sp_Rate_3": 1,
"Item_Sp_Rate_4": 1,
"Item_Sp_Rate_5": 1,
"Item_Pur_Rate": 1,
"Item_MRP": 1,
"HSN_Code": "text",
"Quantity": 1,
"Lot_MRP": 1,
"Rate": 1,
"Tax_Amt_1": 1,
"Tax_Amt_3": 1,
"Pur_MRP": 1,
"Pur_Gross_Amt": 1,
"Pur_Net_Amt": 1,
"Pur_Round_Amt": 1,
"Pur_Net_Rate": 1,
"Gross_Pur_Amt": 1,
"CD": 1,
"TD": 1,
"SP_CD": 1,
"Scheme_Unit": 1,
"Scheme_Rs": 1,
"Freight": 1,
"Adjust_Item": 1,
"Handling": 1,
"Postage": 1,
"ExciseUnit": 1,
"ExcisePercentage": 1,
"CD_Per": 1,
"TD_Per": 1,
"SP_CD_Per": 1,
"Tax_P_1": 1,
"Tax_P_2": 1,
"Tax_P_3": 1,
"Qty_Scanned": 1,
"Qty_Rejected": 1,
"Qty_Excess": 1,
"ItemName": "text",
"ItemHDName": "text",
"ColorName": "text",
"ItemDesc_1": "text",
"CompanyName": "text",
"HSN_Serial_No": "text",
"HSN_Description": "text",
"HSN_UOM": "text",
"Packing": "text",
"Item_Group_Name_1": "text",
"LotPcsInfo": [
{}
]
}
]
}
],
"Status": true,
"Message": "text",
"LastGlobalModifyCode": 1,
"resultSize": "text"
}Response fields
Each item in GetData is one voucher:
Vouch_Code
number
Logic ERP's internal voucher number, unique within a financial year. Use it in Doc_Codes.
Vouch_No
text
The internal voucher number shortened to year, -, month, day and the serial of the day, for example 2026-04081 (first voucher of 8 April 2026). Not the number users see – that is GRN_Prefix and GRN_Number.
Vouch_Date
date
Voucher date, dd/MM/yyyy.
Account_Name
text
Supplier's name as kept in Logic ERP; it can include the city after padding spaces.
Agent_Name
text
The voucher's agent, or NIL.
Quantity
number
Total quantity of the voucher.
Gross_Amount
number
Gross amount in ₹ (quantity × rate, before discounts, charges and taxes).
Net_Amount
number
Voucher total in ₹.
Total_Tax
text
Total of the three tax amounts in ₹, written as text, for example "450".
Branch_Name
text
Name of the voucher's branch; (NIL) for branch 0.
Branch_Code
number
Code of the voucher's branch.
Currency_Name
text
Currency, for example INR.
Bill_No
text
The supplier's bill number.
Bill_Date
date
The supplier's bill date, dd/MM/yyyy.
GRN_Prefix, GRN_Number
text, number
The voucher's series prefix and number as shown in Logic ERP, for example TPB and 2.
Tax_Region_Name
text
The voucher's tax region, for example CGST/SGST or IGST.
Goods_In_Transit
number
1 when the voucher is marked as goods in transit, otherwise 0.
Action_Code
text
Always empty.
Doc_Type_Desc
text
Purchase.
Doc_Type
text
PU.
Gr_Number, Gr_Date
text, date
Transport GR / LR number and date.
Order_No, Order_Date
text, date
Order number and date typed in the voucher's other details.
Header_Remarks_1, Header_Remarks_2, Header_Remarks_3
text
Remarks typed on the voucher.
Transport_Mode
text
Mode of transport, as typed.
Transport_Name
text
Transporter's name as kept in the transporter master; empty when the voucher has no other details.
Trans_ID, Trans_Services
text
Transporter ID and services as kept in the transporter master.
Weight, Cases
text
Weight and number of cases, as typed.
GPN_Number, GPN_Date
text, date
Gate pass number and date of the voucher; empty when none. See the known issue.
ListItems
list
The item lines. See below.
ListItems — one entry per item line:
Pur_Txn_Code
number
Logic ERP's internal line number.
Lot_Code
number
Internal number of the lot (batch) received.
Lot_Number
text
Lot number.
AddlItemCode
text
The item's additional code, for example a barcode.
PackName
text
Pack (size) of the item.
CF_1, CF_2, CF_3
number
The item's conversion factors.
Item_Sale_Rate, Item_Pur_Rate, Item_MRP
number
Sale rate, purchase rate and MRP in the item master today.
Item_Sp_Rate_1 … Item_Sp_Rate_5
number
Special rates 1–5 in the item master today.
HSN_Code, HSN_Serial_No, HSN_Description, HSN_UOM
text
HSN code, serial number, description and unit of the item ((NIL) / empty when none).
Quantity
number
Quantity on the line.
Lot_MRP
number
MRP of the lot.
Rate
number
Purchase rate on the line.
Tax_P_1, Tax_P_2, Tax_P_3
number
Tax rates (%) of the three tax slots of the line.
Tax_Amt_1, Tax_Amt_3
number
Tax amounts of slots 1 and 3, in ₹. There is no amount for slot 2. With the usual GST setup slot 1 holds CGST and slot 3 SGST or IGST.
Pur_MRP
number
MRP used on the line; normally the same as Lot_MRP.
Pur_Gross_Amt
number
Quantity × rate, in ₹.
Pur_Net_Amt
number
Line total, in ₹.
Pur_Round_Amt
number
Rounding on the line.
Pur_Net_Rate
number
Net rate per unit.
Gross_Pur_Amt
number
A second gross amount kept on the line; 0 on many lines. Use Pur_Gross_Amt.
CD, TD, SP_CD
number
Cash discount, trade discount and special cash discount amounts in ₹; a cash discount comes back as a negative amount.
CD_Per, TD_Per, SP_CD_Per
number
The percentages of those discounts.
Scheme_Unit, Scheme_Rs
number
Scheme discount per unit and in rupees.
Freight, Adjust_Item, Handling, Postage, ExciseUnit
number
Freight, adjustment, handling, postage and excise-per-unit amounts on the line, in ₹.
ExcisePercentage
number
Despite its name, an amount: the market-fee charge on the line.
Qty_Scanned, Qty_Rejected
number
Quantity scanned and quantity rejected for this line in the physical verification of the voucher; 0 when not verified.
Qty_Excess
number
Quantity recorded for this item in the difference list of the physical verification. It is kept per item, so every line of the same item shows the same value; 0 when none.
ItemName
text
Item name.
ItemHDName
text
Item name with its colour, as shown in the item master.
ColorName
text
Colour, or (NIL).
ItemDesc_1
text
Item description.
CompanyName
text
Item's company (brand).
Packing
text
Packing description from the item master.
Item_Group_Name_1
text
Item's group.
LotPcsInfo
list
Always an empty list here.
Example response
Messages you may see
No Purchase Voucher found... (with Status: true)
Nothing has been added to the change log after your bookmark.
You are up to date. Call again later with the same bookmark.
No Record Found. (with Status: true)
No purchase voucher matched: the batch held only returns, stock transfers in or vouchers outside your filters, nothing in the period was a purchase voucher, or the numbers you sent are not purchase vouchers of that financial year.
With a bookmark: store the new LastGlobalModifyCode and call again. Otherwise: check what you sent.
A database error (with Status: false), for example a message containing Invalid column name 'abc'.
Doc_Codes or Branch_Codes_From contained something other than numbers and commas. The reason may be followed by technical detail – read the first line.
Send numbers separated by commas.
The date messages listed in How Every API Call Works (with Status: true)
A period request with a missing or invalid date.
Send both dates as yyyy-MM-dd, or both as null.
Last updated