Get Purchase Orders
Returns your purchase orders from Logic ERP, each with its header (supplier, branch, department, amounts and tax, supplier's order and quotation numbers, delivery details, cancellation) and its item lines (item, lot, ordered and pending quantity, rate, MRP and tax rates). Use it to copy new and changed purchase orders into your own system – normally by asking only for orders added or changed since your last call – or to fetch particular orders by Logic ERP's internal number. With ApprovalFilter you can follow approved orders only.
Endpoint
Address
https://your-server/api/GetPurchaseOrder
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 day an order was saved, edited or – with ApprovalFilter "1" – approved; not the order date). Send both as null when you are not asking for a period – with GlobalModifyCode 0 and no Doc_Codes, leaving them out gives Invalid Date From.. (with a bookmark they are not checked). Write them as yyyy-MM-dd.
Doc_Codes
text
No
empty
Logic ERP's internal order numbers (Vouch_Code in the response), separated by commas, for example "1869,1870". Returns exactly these orders; the bookmark and period are ignored. Numbers and commas only.
ApprovalFilter
text
No
"0"
"1" = only approved orders, followed through the approval change log (see the rules); "2" = only orders still waiting for approval; anything else = both. Applies in every kind of request.
Branch_Codes_From
text
No
empty
Branch codes separated by commas, for example "2,5". Used only in a period request – see the known issue.
Doc_Num_Like
text
No
empty
Only orders whose number starts with this text, written prefix-number, for example "PO-" or "PO-13". Used with the bookmark or a period.
Field names are matched without regard to upper or lower case. Other fields in the request are ignored.
Rules Logic ERP applies
Two change logs. Normally the change log of purchase-order saves is read. With
"ApprovalFilter": "1"the change log of purchase-order approvals is read instead, so you receive an order when it is approved. The two logs number their lines differently: keep a separate bookmark for requests withApprovalFilter"1", and do not mix them.With a bookmark, each call reads up to 150 change-log lines and returns the orders they belong to. When none of them can be returned (for example deleted orders, or orders excluded by
ApprovalFilter), you get"No Record Found."withStatus: trueand a higherLastGlobalModifyCode– store it and call again. You have caught up when the message is"No Pending Purchase Order found..."andLastGlobalModifyCodeis the value you sent.An order can come back in a later batch. Every save of an order adds a line to the change log, so an order edited after your bookmark is returned again with its current details. Update it in your system; do not add it a second time.
Not split by financial year. Purchase orders are not kept per financial year, so
Vouch_Codeidentifies an order without a year, and orders of every year are returned. The change-log problem with earlier financial years that affects some other endpoints does not apply here.What is returned. Despite the "pending" in the messages, every order in the batch is returned, also when it has been fully received; check
Pending_Qtyon the lines. Cancelled orders are returned withCancel_Order: true, cancelled lines withCancel_Item: true. Orders deleted in Logic ERP are not returned, so a deletion does not reach you through this endpoint.With
Doc_Codesand with a period request,LastGlobalModifyCodecomes back as0– do not store it.DateFromandDateToonly select changes for a period request; they never filter on the order date, and they are ignored whenDoc_Codesis filled.Every line must find its item, and the order its supplier, agent, branch, currency, department, transporter, transfer party, tax region and delivery-address records. A line or order that cannot is left out – see the known issue on orders without a tax region.
Orders and their lines are not returned in any guaranteed order.
Dates in the response are text
dd/MM/yyyy, for example05/10/2026, exceptValid_Till– see the known issue. A date that is not filled is"".
Known issue – orders without a tax region are never returned. A purchase order saved without a tax region is left out of every response, also when you name it in
Doc_Codes, and a batch that holds only such orders answers"No Record Found.". Make sure every purchase order has a tax region, or ask your Logic ERP team.
Known issue –
Branch_Codes_Fromis ignored with a bookmark and withDoc_Codes. Orders of all branches are returned. It filters only in a period request (GlobalModifyCode0withDateFromandDateTo), and there a value that is not numbers and commas is silently ignored. Filter onBranch_Namein your system.
Known issue –
Total_Taxis not the order's whole tax. It holds only the first tax amount, so with CGST + SGST it shows the CGST half (a ₹200 order with 2.5% + 2.5% shows5.0, not10.0). Work out the tax asNet_Order_Amount−Order_Amount.
Known issue –
Valid_Tillis written in the server's short date format. On most servers this isdd/MM/yy, for example05/10/26, unlike the other dates. Read it as day/month/two-digit year.
Known issue – a database error starts with technical text. When
Doc_Codesis not numbers and commas,Messagestarts with technical detail before the reason (for example beforeInvalid column name 'abc'.). Look for the reason inside the message.
Example request
Next batch after your stored bookmark:
Approved orders only (keep this bookmark separately):
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 orders from Logic ERP, each with its header (supplier, branch, department, amounts and tax, supplier's order and quotation numbers, delivery details, cancellation) and its item lines (item, lot, ordered and pending quantity, rate, MRP and tax rates). Use it to copy new and changed purchase orders into your own system – normally by asking only for orders added or changed since your last call – or to fetch particular orders by Logic ERP's internal number. With ApprovalFilter you can follow approved orders only.
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 day an order was saved, edited or – with ApprovalFilter "1" – approved; not the order date). Send both as null when you are not asking for a period – with GlobalModifyCode 0 and no Doc_Codes, leaving them out gives Invalid Date From.. (with a bookmark they are not checked). Write them as yyyy-MM-dd.
With GlobalModifyCode 0: a period of changes (the day an order was saved, edited or – with ApprovalFilter "1" – approved; not the order date). Send both as null when you are not asking for a period – with GlobalModifyCode 0 and no Doc_Codes, leaving them out gives Invalid Date From.. (with a bookmark they are not checked). Write them as yyyy-MM-dd.
Logic ERP's internal order numbers (Vouch_Code in the response), separated by commas, for example "1869,1870". Returns exactly these orders; the bookmark and period are ignored. Numbers and commas only.
"1" = only approved orders, followed through the approval change log (see the rules); "2" = only orders still waiting for approval; anything else = both. Applies in every kind of request.
Branch codes separated by commas, for example "2,5". Used only in a period request – see the known issue.
Only orders whose number starts with this text, written prefix-number, for example "PO-" or "PO-13". Used with the bookmark or a period.
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/GetPurchaseOrder 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,
"Order_Prefix": "text",
"Order_Number": 1,
"Order_Date": "text",
"Party_Name": "text",
"Print_Act_Name": "text",
"Party_User_Code": "text",
"Agent_Name": "text",
"Branch_Name": "text",
"Branch_Short_Name": "text",
"Exchange_Rate": 1,
"Currency_Name": "text",
"Order_Amount": 1,
"Total_Tax": 1,
"Net_Order_Amount": 1,
"Supplier_Order_No": "text",
"Delivery_Date": "text",
"Quotation_No": "text",
"Transfer_Branch_Name": "text",
"Transfer_Branch_Code": 1,
"Quotation_Date": "text",
"Action_Code": "text",
"Cancel_Order": true,
"Department_Name": "text",
"Transpoter_Name": "text",
"Transfer_PartyName": "text",
"Tax_Region": "text",
"Valid_Till": "text",
"Delivery_At": "text",
"Delivery_Add_1": "text",
"Delivery_Add_2": "text",
"Delivery_Add_3": "text",
"ListItems": [
{
"Txn_Code": 1,
"Logic_UserCode": "text",
"Lot_Number": "text",
"CF_Qty": 1,
"Total_Qty": 1,
"Rate": 1,
"Pending_Qty": 1,
"PO_MRP": 1,
"EAN_Code": "text",
"Cancel_Item": true,
"Tax_1": 1,
"Tax_2": 1,
"Tax_3": 1
}
]
}
],
"Status": true,
"Message": "text",
"LastGlobalModifyCode": 1,
"resultSize": "text"
}Response fields
Each item in GetData is one purchase order:
Vouch_Code
number
Logic ERP's internal order number. Use it in Doc_Codes.
Order_Prefix
text
Order prefix, for example PO.
Order_Number
number
Order number within the prefix.
Order_Date
date
Order date, dd/MM/yyyy.
Party_Name
text
Name of the supplier as kept in Logic ERP, usually with its city; there may be several spaces before the - and the city.
Print_Act_Name
text
The supplier's print name.
Party_User_Code
text
Code of the supplier as shown in Logic ERP.
Agent_Name
text
The order's agent, or NIL.
Branch_Name, Branch_Short_Name
text
Name and short name of the order's branch.
Exchange_Rate
number
Exchange rate of the order's currency; 1 for rupees.
Currency_Name
text
Currency, for example INR.
Order_Amount
number
Order value before taxes.
Total_Tax
number
The order's first tax amount only – see the known issue.
Net_Order_Amount
number
Order total.
Supplier_Order_No
text
The supplier's reference number typed on the order.
Delivery_Date
date
Delivery date, dd/MM/yyyy; "" when not filled.
Quotation_No, Quotation_Date
text, date
Supplier's quotation number and date; empty when not filled.
Transfer_Branch_Code
number
The branch the goods are ordered for, when the order is placed on behalf of another branch; 0 or -1 when none.
Transfer_Branch_Name
text
Name of that branch; "" when none.
Transfer_PartyName
text
The transfer party on the order, or (NIL) (may end in spaces).
Action_Code
text
The order's latest save: N = added, M = modified; empty when the order has no change-log line.
Cancel_Order
true / false
true when the order has been cancelled.
Department_Name
text
Department on the order, or (NIL).
Transpoter_Name
text
Transporter (the name is spelt this way), or (NIL).
Tax_Region
text
The order's tax region, for example CGST/SGST or IGST.
Valid_Till
text
Date the order is valid until – see the known issue.
Delivery_At
text
The delivery place of the order's delivery address; null when the order's delivery address has no text (also when no delivery address was chosen).
Delivery_Add_1, Delivery_Add_2, Delivery_Add_3
text
The lines of that delivery address; null when the address has no such line.
ListItems
list
The item lines. See below.
ListItems — one entry per order line:
Txn_Code
number
Logic ERP's internal line number.
EAN_Code
text
The item's additional code, for example a barcode.
Lot_Number
text
Lot number planned for the goods, for example PO-132; empty when none.
CF_Qty
number
Conversion factor of the line's quantity.
Total_Qty
number
Quantity ordered.
Pending_Qty
number
Quantity not yet received.
Rate
number
Purchase rate on the line.
PO_MRP
number
MRP on the line; 0 when not set.
Cancel_Item
true / false
true when the line has been cancelled.
Tax_1, Tax_2, Tax_3
number
Tax rates (%) of the three tax slots of the line; with GST usually CGST in slot 1 and SGST or IGST in slot 3. 0 when the line has no tax details.
Example response
Messages you may see
No Pending Purchase Order 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)
Change-log lines were found but no order could be returned (deleted orders, orders excluded by ApprovalFilter or by a period's Branch_Codes_From, orders without a tax region), or no order was changed in the period, or the Doc_Codes you sent found nothing.
With a bookmark: store the new LastGlobalModifyCode and call again. Otherwise: check what you sent.
A message containing a database error (with Status: false), for example Invalid column name 'abc'.
Doc_Codes contains something other than numbers and commas. The message starts with technical detail – see the known issue.
Send Doc_Codes as numbers separated by commas.
Last updated