Save GR Details for Sale Invoices
Records the dispatch (GR) details of one or more sale invoices when the goods are handed to a transporter. A GR (goods receipt, also called LR – lorry receipt) is the transporter's consignment note. One request creates one GR document in Logic ERP – a numbered list of the invoices sent together – and writes the transport details onto each invoice: transporter, GR number and date, vehicle, delivery address, weight, cases, box size, shipping label and tracking link. To change details later, use Edit GR Details of Sale Invoices.
Endpoint
Address
https://your-server/api/SaveGREntryAgainstSale
Method
POST
Authorization
Basic Auth
The response and the common messages are explained in How Every API Call Works.
Field names are matched without regard to upper/lower case; fields not listed below are ignored. Note the spelling Transpoter_Name.
Request fields
Doc_Prefix
text
Yes
–
Prefix of the GR document, for example "LR". Stored in capitals. The document number is the next free number for this prefix in the branch – you cannot choose it.
Doc_Date
date
No
today
Date of the GR document, yyyy-MM-dd. A value that is not a date is replaced by today's date.
Remarks
text
No
empty
Remarks of the GR document.
BranchShortName
text
One of the two
empty
The branch short name, used when BranchCode is 0.
ListBills
list
Yes
–
The invoices sent with this GR, one entry each. See the table below. Send at least one.
Ext_Doc_No, Doc_Remarks_1, Doc_Remarks_2, Pickup_Date, Pickup_Delv_Date, Pickup_Stage, Estimated_Delv_Days, Non_Delv_Reason, Non_Delv_Date
–
No
–
Ignored – accepted but not saved (see the known issue below).
EditEntry
text
No
"0"
Ignored. To change a saved GR use the edit endpoint.
DisplayError
text
No
"0"
"1" = Message carries the full technical detail when the save fails.
ListBills
Identify each invoice in one of three ways, tried in this order: BillSeries with BillNumber, then NewBillNo, then BillNo.
BillSeries
text
One of the three ways
empty
Bill series of the invoice, for example "ESL". Used with BillNumber. Recommended.
BillNumber
number
With BillSeries
0
Invoice number within the series, for example 346.
NewBillNo
text
One of the three ways
empty
The printed invoice number, for series that use their own number format (for example "2627/ESL-346").
BillNo
text
One of the three ways
empty
Series and number joined by a hyphen, for example "ESL-346". See the known issue below.
GR_Number_1
text
No
keeps the invoice's value
The GR / LR number given by the transporter.
GR_Date_1
date
No
keeps the invoice's value
Date of GR_Number_1, yyyy-MM-dd. Saved only when GR_Number_1 is also sent.
GR_Number_2, GR_Date_2
text, date
No
keeps the invoice's value
A second GR number and its date, used the same way.
Transpoter_Name
text
No
cleared
Transporter, exactly as named in Logic ERP's transport list. It must exist. Leaving it empty removes the transporter from the invoice – see the known issue below.
Agent_Name
text
No
cleared
Agent (salesman / broker) of the invoice, exactly as named in Logic ERP. It must exist. Leaving it empty removes the agent – see the known issue below.
Vehicle_No
text
No
keeps the invoice's value
Vehicle number. A new value is also added to Logic ERP's list of vehicle numbers.
Transport_Mode
text
No
keeps the invoice's value
Mode of transport, for example "ROAD". A new value is also added to Logic ERP's list of transport modes.
Weight, Cases, Pvt_Mark
text
No
keep the invoice's value
Weight, number of cases or packages, and private mark.
Challan_No, Challan_Date
text, date
No
keep the invoice's value
The transporter's challan number and date. The date is saved only with a number.
Issue_Time, Removal_Time
text
No
keep the invoice's value
Times of issue and of removal of the goods, for example "06:49 PM". A value that is not a time is not saved, and the time already on the invoice is then cleared. When the invoice has no issue time yet, the time the invoice was created is used.
Delivery_At, Delivery_Add1, Delivery_Add2
text
No
keep the invoice's value
Delivery place and address lines.
Doc_Remarks
text
No
empty
Remark for this invoice inside the GR document.
Packing_Box_Length, Packing_Box_Width, Packing_Box_Height, Packing_Box_Net_Weight
number
No
keep the invoice's value
Box size and net weight. Saved only when above 0.
ShippingLabel, TrackingUrl
text
No
keep the invoice's value
Shipping label reference and the tracking link.
BillDate, Remarks1, Remarks2, Remarks3, Way_Bill_No, GRN_Prefix, GRN_Number
–
No
–
Ignored. The way bill number is assigned by Logic ERP (see the rules).
Rules Logic ERP applies
Which invoices. Every invoice must belong to the branch and to the current financial year – the year containing today's date on the server, whatever
Doc_Datesays. If any invoice is not found, nothing is saved.One GR per invoice. An invoice already listed in another GR document cannot be added again; nothing is saved and the message lists those invoices. To change its details, use Edit GR Details of Sale Invoices.
What is saved. A GR document is created with
Doc_Prefix, the next number,Doc_Date,Remarksand the list of invoices. On each invoice the transport details are written. A field you leave empty keeps the value the invoice already has – exceptTranspoter_NameandAgent_Name.Agent. The agent you send (or none) becomes the agent of the invoice and of its accounting entries.
Way bill. When a transporter is given and Logic ERP holds pre-loaded way bill (air waybill) numbers for that transporter in the branch, the next unused one is linked to the invoice and marked as used.
GR number 2 by configuration. If your Logic ERP team has set the GR screen to copy the GR document number into the second GR number, a number is filled in for invoices where you leave
GR_Number_2empty. It is built from the GR screen's default prefix and its next number, so it may not match theDoc_Prefixand number of the GR document you created; sendGR_Number_2yourself if it must match.All or nothing. The GR document and all invoice updates are saved together; if one invoice fails, nothing is saved.
Each invoice gets an audit-trail entry.
Known issue – agent and transporter are cleared when left out.
Agent_NameandTranspoter_Nameare always written to the invoice. If you leave either empty, the invoice's existing agent or transporter is removed. Always send both, repeating the values the invoice already has.
Known issue –
BillNoworks only for three-letter series.BillNo(for example"ESL-346") finds the invoice only when the series has exactly three characters. For other series the invoice is not found. UseBillSerieswithBillNumberinstead.
Known issue – extra GR document fields are not saved.
Ext_Doc_No,Doc_Remarks_1,Doc_Remarks_2and the pickup and non-delivery fields are accepted but not stored. In particular a GR saved here cannot later be found byExt_Doc_No; use the GR prefix and number returned inLastSavedDocNo.
Known issue –
request_IDis empty. This endpoint does not return arequest_IDand does not mark the request as completed in Logic ERP's request log. KeepLastSavedCodeandLastSavedDocNoinstead.
Known issue – failure after saving. When automatic export of stock-transfer documents is switched on for your company, Logic ERP runs it after the GR is saved. If that step fails, the answer is
Status: falsealthough the GR document was saved. Do not simply resend: a resend fails with … Bills belongs to another Document…. Check the invoices in Logic ERP first.
Example request
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. This really saves in the sandbox, so use test values like the example. The example's invoice already belongs to a GR document, so sending it unchanged is refused; save a new test invoice first and put its number in the request.
Records the dispatch (GR) details of one or more sale invoices when the goods are handed to a transporter. A GR (goods receipt, also called LR – lorry receipt) is the transporter's consignment note. One request creates one GR document in Logic ERP – a numbered list of the invoices sent together – and writes the transport details onto each invoice: transporter, GR number and date, vehicle, delivery address, weight, cases, box size, shipping label and tracking link. To change details later, use Edit GR Details of Sale Invoices.
The user name and password of your API site.
Prefix of the GR document, for example "LR". Stored in capitals. The document number is the next free number for this prefix in the branch – you cannot choose it.
Date of the GR document, yyyy-MM-dd. A value that is not a date is replaced by today's date.
Remarks of the GR document.
The branch of the invoices (Branch_Code in Get Branch Info).
Always HTTP 200. Check Status and Message.
The GR document number: prefix and number joined by a hyphen, for example "LR-8".
true when the GR document was saved.
"Success" when saved; otherwise the reason.
Logic ERP's internal number of the GR document.
Always empty for this endpoint (see the known issue).
No login was sent.
POST /api/SaveGREntryAgainstSale HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 226
{
"Doc_Prefix": "APIGR",
"Doc_Date": "2026-10-30",
"Remarks": "API TEST",
"BranchCode": 2,
"ListBills": [
{
"BillSeries": "WSL",
"BillNumber": 166,
"GR_Number_1": "APITEST-GR-001",
"GR_Date_1": "2026-10-30",
"Transport_Mode": "ROAD",
"Cases": "1"
}
]
}{
"LastSavedDocNo": "text",
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
Status
true / false
true when the GR document was saved.
Message
text
"Success" when saved; otherwise the reason.
LastSavedCode
number
Logic ERP's internal number of the GR document.
LastSavedDocNo
text
The GR document number: prefix and number joined by a hyphen, for example "LR-8".
request_ID
text
Always empty for this endpoint (see the known issue).
Example response
Messages you may see
Invalid Doc_Prefix....
Doc_Prefix is empty.
Send a prefix.
Unable to Retrive Bill No.…-… BranchCode : …
An invoice was not found in the branch and the current financial year (the message shows BillSeries-BillNumber, even when you used another way).
Check the series, number and branch.
Unable to found Transpoter Name : …
No transporter with that name.
Use the name exactly as in Logic ERP.
Unable to found Agent : …
No agent with that name.
Use the name exactly as in Logic ERP.
… Bills belongs to another Document. Cannot Retrived...
The listed invoices are already in another GR document.
Use the edit endpoint for them, or leave them out.
An item with the same key has already been added.
The same invoice appears twice in ListBills.
List each invoice once.
A message containing Branch_Short_Name : … not exists. (with technical detail around it)
BranchShortName does not exist.
Check the short name.
Last updated