For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Name
Detail

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.

Field
Type
Required
Default
Meaning

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.

Field
Type
Required
Default
Meaning

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)

Field
Type
Required
Default
Meaning

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 ListBills empty, the same values are written to every invoice in the GR document.

    • With ListBills filled, 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_Days is always written (as 0 when left out), so on those databases an edit by Doc_Prefix/Doc_Number or Ext_Doc_No fails with a technical error. Where the fields exist (as on the sandbox) it works, but sending Doc_Remarks_2, Pickup_Date or Pickup_Delv_Date makes it fail. If it fails on your database, edit the invoices one at a time with Bill_No – note that Bill_No needs a printed invoice number, which only series with their own number format have.

Known issue – Ext_Doc_No cannot 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 by Ext_Doc_No. Use Doc_Prefix and Doc_Number.

Known issue – per-invoice Removal_Time. In ListBills, an invoice's Removal_Time is written only when the top-level Removal_Time is 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_Days is reset. Where the GR document fields exist, leaving Estimated_Delv_Days out sets it to 0 on 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.

Edit GR Details of Sale Invoices

post

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.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
BranchCodeintegerOptional

The branch (Branch_Code in Get Branch Info). The invoice or GR document is looked for in this branch.

Bill_NostringOptional

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_PrefixstringOptional

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.

Doc_NumberintegerOptional

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.

GR_NostringOptional

The (first) GR / LR number.

GR_DatestringOptional

Date of the GR, yyyy-MM-dd.

CasesstringOptional

Number of cases or packages.

Remarks_1stringOptional

The three remark lines of the invoice.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
LastSavedDocNostringOptional

One invoice: the Bill_No you sent. GR document: its external number, or prefix and number joined by a hyphen (for example "LR-8").

StatusbooleanOptional

true when the changes were saved.

MessagestringOptional

"Success" when saved; otherwise the reason.

LastSavedCodeintegerOptional

One invoice: Logic ERP's internal number of the invoice. GR document: the internal number of the GR document.

request_IDstringOptional

As described on the common page. null when the invoice or GR document was not found.

post/EditGREntryAgainstSale
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

Field
Type
Meaning

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

Message
Meaning
What to do

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.