Edit GR Details of Sale Invoices
Changes some dispatch (GR) details already recorded on sale invoices – the GR number and date, vehicle number, cases, removal time, gate-pass date and three remark lines. You can edit one invoice by its printed invoice number, or every invoice of a GR document at once. Unlike Save GR Details for Sale Invoices, this endpoint creates nothing: it does not create a GR document, does not add or remove invoices, and does not change the transporter, agent, delivery address or second GR number.
Endpoint
Address
https://your-server/api/EditGREntryAgainstSale
Method
POST
Authorization
Basic Auth
The response and the common messages are explained in How Every API Call Works.
It uses the licence of Save GR Details for Sale Invoices. Field names are matched without regard to upper/lower case; fields not listed below are ignored.
Request fields
Which invoices to edit – send Bill_No for one invoice, or leave it empty and name a GR document.
Bill_No
text
One of the ways
empty
The printed invoice number of one invoice, for example "2627/ESL-346" (only series with their own number format have one). When filled, only this invoice is edited and the GR document fields below are not used.
Doc_Prefix, Doc_Number
text, number
One of the ways
empty, 0
Prefix and number of a GR document (the two parts of LastSavedDocNo from the save, for example "LR" and 8). Used when Bill_No is empty.
Ext_Doc_No
text
One of the ways
empty
An external number of a GR document. Used instead of Doc_Prefix/Doc_Number when filled – but see the known issue below.
BranchCode
number
One of the two
0
The branch (Branch_Code in Get Branch Info). The invoice or GR document is looked for in this branch.
BranchShortName
text
One of the two
empty
The branch short name, used when BranchCode is 0.
DisplayError
text
No
"0"
"1" = Message carries the full technical detail when the edit fails.
Values written to the invoices – a field left empty keeps the invoice's present value; you cannot clear a value with this endpoint.
GR_No
text
No
unchanged
The (first) GR / LR number.
GR_Date
date
No
unchanged
Date of the GR, yyyy-MM-dd.
Vehicle_No
text
No
unchanged
Vehicle number.
Cases
text
No
unchanged
Number of cases or packages.
Removal_Time
text
No
unchanged
Time the goods left, for example "07:15 PM". Saved only when it is a valid time.
Token_GP_Date
date
No
unchanged
Token / gate-pass date, yyyy-MM-dd.
Remarks_1, Remarks_2, Remarks_3
text
No
unchanged
The three remark lines of the invoice.
ListBills
list
No
empty
Only when editing by GR document: different values per invoice. See below.
ListBills (GR document only)
Bill_No
text
Yes
–
The printed invoice number of an invoice in the GR document.
GR_No, GR_Date, Vehicle_No, Cases, Removal_Time, Token_GP_Date, Remarks_1, Remarks_2, Remarks_3
as above
No
unchanged
Values for this invoice, as in the table above.
GR document fields – Doc_Remarks_1, Doc_Remarks_2, Pickup_Stage, Estimated_Delv_Days, Non_Delv_Reason, Pickup_Date, Pickup_Delv_Date, Non_Delv_Date: written to the GR document when editing by GR document. See the known issue below before using them.
Rules Logic ERP applies
One invoice (
Bill_No). The invoice must belong to the branch and to the current financial year (the year containing today's date on the server), and must have a printed invoice number. It does not need to be in a GR document. The values in the request are written to it.A GR document. The GR document must be a sale GR document of the branch; it may be of any year.
With
ListBillsempty, the same values are written to every invoice in the GR document.With
ListBillsfilled, every invoice in the GR document must be listed by its printed number; each gets its own values. If one is missing, nothing is changed and you get Unable to found Bill No. : …. Invoices you list that are not in the GR document are ignored.
Empty values never overwrite: only fields you fill are changed.
All changes are saved together; if one fails, nothing is changed.
No audit-trail entry is written for this edit.
Known issue – editing by GR document fails on most databases. The GR document fields are missing in most Logic ERP databases, and
Estimated_Delv_Daysis always written (as0when left out), so on those databases an edit byDoc_Prefix/Doc_NumberorExt_Doc_Nofails with a technical error. Where the fields exist (as on the sandbox) it works, but sendingDoc_Remarks_2,Pickup_DateorPickup_Delv_Datemakes it fail. If it fails on your database, edit the invoices one at a time withBill_No– note thatBill_Noneeds a printed invoice number, which only series with their own number format have.
Known issue –
Ext_Doc_Nocannot find a GR saved through the API. Save GR Details for Sale Invoices does not store an external number, so a GR document it created is never found byExt_Doc_No. UseDoc_PrefixandDoc_Number.
Known issue – per-invoice
Removal_Time. InListBills, an invoice'sRemoval_Timeis written only when the top-levelRemoval_Timeis also filled with a valid time; and it is then written without being checked, so an invalid per-invoice value makes the whole edit fail.
Known issue –
Estimated_Delv_Daysis reset. Where the GR document fields exist, leavingEstimated_Delv_Daysout sets it to0on the GR document. Send the present value.
Example request
One invoice:
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 edits the sandbox's test GR document APIGR-1.
Changes some dispatch (GR) details already recorded on sale invoices – the GR number and date, vehicle number, cases, removal time, gate-pass date and three remark lines. You can edit one invoice by its printed invoice number, or every invoice of a GR document at once. Unlike Save GR Details for Sale Invoices, this endpoint creates nothing: it does not create a GR document, does not add or remove invoices, and does not change the transporter, agent, delivery address or second GR number.
The user name and password of your API site.
The branch (Branch_Code in Get Branch Info). The invoice or GR document is looked for in this branch.
The printed invoice number of one invoice, for example "2627/ESL-346" (only series with their own number format have one). When filled, only this invoice is edited and the GR document fields below are not used.
Prefix and number of a GR document (the two parts of LastSavedDocNo from the save, for example "LR" and 8). Used when Bill_No is empty.
Prefix and number of a GR document (the two parts of LastSavedDocNo from the save, for example "LR" and 8). Used when Bill_No is empty.
The (first) GR / LR number.
Date of the GR, yyyy-MM-dd.
Number of cases or packages.
The three remark lines of the invoice.
Always HTTP 200. Check Status and Message.
One invoice: the Bill_No you sent. GR document: its external number, or prefix and number joined by a hyphen (for example "LR-8").
true when the changes were saved.
"Success" when saved; otherwise the reason.
One invoice: Logic ERP's internal number of the invoice. GR document: the internal number of the GR document.
As described on the common page. null when the invoice or GR document was not found.
No login was sent.
POST /api/EditGREntryAgainstSale HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 148
{
"BranchCode": 2,
"Bill_No": "",
"Doc_Prefix": "APIGR",
"Doc_Number": 1,
"GR_No": "APITEST-GR-001",
"GR_Date": "2026-10-30",
"Cases": "2",
"Remarks_1": "API TEST"
}{
"LastSavedDocNo": "text",
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
Status
true / false
true when the changes were saved.
Message
text
"Success" when saved; otherwise the reason.
LastSavedCode
number
One invoice: Logic ERP's internal number of the invoice. GR document: the internal number of the GR document.
LastSavedDocNo
text
One invoice: the Bill_No you sent. GR document: its external number, or prefix and number joined by a hyphen (for example "LR-8").
request_ID
text
As described on the common page. null when the invoice or GR document was not found.
Example response
Messages you may see
Please Define Ext_Doc_No Or Doc_Prefix And Doc_Number to Continue...
Bill_No is empty and no GR document was named.
Send Bill_No, or Doc_Prefix with Doc_Number.
Unable to found Sale GR Entry....
The invoice (by Bill_No) or the GR document was not found in the branch. For Bill_No, the invoice must be of the current financial year and have a printed number.
Check the number, branch and year.
Unable to found Bill No. : …
With ListBills, an invoice of the GR document is not listed. The message shows that invoice's printed number (empty when it has none).
List every invoice of the GR document, or send ListBills empty.
A message containing Branch_Short_Name : … not exists. (with technical detail around it)
BranchShortName does not exist.
Check the short name.