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

Save GR Details for Purchase Returns

Records the transport (GR) details of goods sent back to suppliers on one or more purchase returns – the transporter's consignment note (GR, also called LR – lorry receipt) under which the returned goods were dispatched. One request creates one GR document in Logic ERP – a numbered list of the purchase returns sent together – and writes the transport details onto each return: transporter, GR number and date, vehicle, weight, cases, delivery place and times. This is what the Enter G.R. Details - Purchase screen (Purchase menu) does for purchase returns.

For purchase vouchers use Save GR Details for Purchase Vouchers; for sale invoices, Save GR Details for Sale Invoices. There is no endpoint to edit a purchase-return GR document.

Endpoint

Name
Detail

Address

https://your-server/api/SaveGREntryAgainstPurchaseReturn

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

Field
Type
Required
Default
Meaning

Doc_Prefix

text

Yes

–

Prefix of the GR document, for example "RGR". Stored in capitals. The document number is the next free number for this prefix in the branch (shared with GR documents for purchase vouchers and purchase challans) – 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.

BranchCode

number

One of the two

0

The branch of the returns (Branch_Code in Get Branch Info).

BranchShortName

text

One of the two

empty

The branch short name, used when BranchCode is 0.

ListBills

list

Yes

–

The purchase returns dispatched under 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, EditEntry

–

No

–

Ignored.

DisplayError

text

No

"0"

"1" = Message carries the full technical detail when the save fails.

ListBills

Field
Type
Required
Default
Meaning

BillNo

text

Yes

–

The bill number on the purchase return (Bill_No in Get Purchase Returns). It must match exactly one purchase return in the branch and the current financial year.

GRN_Prefix, GRN_Number

text, number

No

–

The return's prefix and number. Do not send – see the known issue below.

GR_Number_1

text

No

keeps the return's value

The GR / LR number given by the transporter.

GR_Date_1

date

No

keeps the return's value

Date of GR_Number_1, yyyy-MM-dd. Saved only when GR_Number_1 is also sent.

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 return – see the known issue below.

Agent_Name

text

No

cleared

Agent (broker) of the return, 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 return's value

Vehicle number. A new value is also added to Logic ERP's list of purchase vehicle numbers.

Transport_Mode

text

No

keeps the return's value

Mode of transport, for example "ROAD". A new value is also added to Logic ERP's list of purchase transport modes.

Weight, Cases, Pvt_Mark

text

No

keep the return's value

Weight, number of cases or packages, and private mark.

Challan_No, Challan_Date

text, date

No

keep the return'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 return's value

Times, for example "04:15 PM". A value that is not a time is not saved, and the time already on the return is then cleared. When the return has no issue time yet, the time the return was created is used.

Delivery_At, Delivery_Add1, Delivery_Add2

text

No

keep the return's value

Delivery place and address lines (normally the supplier's address).

Doc_Remarks

text

No

empty

Remark for this return inside the GR document.

ShippingLabel, TrackingUrl

text

No

–

Do not send – a value makes the request fail (see the known issue below).

GR_Number_2, GR_Date_2, Packing_Box_Length, Packing_Box_Width, Packing_Box_Height, Packing_Box_Net_Weight, BillSeries, BillNumber, NewBillNo, BillDate, Remarks1, Remarks2, Remarks3

–

No

–

Ignored for purchase returns.

Rules Logic ERP applies

  • Which returns. Each BillNo must match exactly one purchase return in the branch and the current financial year (the year containing today's date on the server, whatever Doc_Date says). Purchase vouchers are not searched. If any return is not found, nothing is saved.

  • One GR per return. A return already listed in another purchase-return GR document cannot be added again; nothing is saved and the message lists those returns by prefix and number.

  • What is saved. A GR document is created with Doc_Prefix, the next number, Doc_Date, Remarks and the list of returns. On each return the transport details are written. A field you leave empty keeps the value the return already has – except Transpoter_Name and Agent_Name.

  • Agent. The agent you send (or none) becomes the agent of the return and of its accounting entries.

  • E-way bill. An e-way bill already linked to the return is kept.

  • All or nothing. The GR document and all return updates are saved together; if one return fails, nothing is saved.

  • Each return gets an audit-trail entry.

Known issue – GRN prefix and number do not work. Sending GRN_Prefix with a GRN_Number makes the request fail with a database error, and nothing is saved. Identify each return by BillNo only. If that bill number is used on more than one purchase return in the branch this year, the return cannot be found through the API – enter its GR details on the screen.

Known issue – agent and transporter are cleared when left out. Agent_Name and Transpoter_Name are always written to the return. If you leave either empty, the return's existing agent or transporter is removed. Always send both, repeating the values the return already has.

Known issue – shipping label and tracking link make the request fail. A value in ShippingLabel or TrackingUrl stops the request with Column 'Shipping_Label' does not belong to table . (or 'Tracking_Url'), and nothing is saved. Leave both out.

Known issue – request_ID is empty. This endpoint does not return a request_ID and does not mark the request as completed in Logic ERP's request log. Keep LastSavedCode and LastSavedDocNo instead.

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 return already belongs to a GR document, so sending it unchanged is refused; use a return of your own.

Save GR Details for Purchase Returns

post

Records the transport (GR) details of goods sent back to suppliers on one or more purchase returns – the transporter's consignment note (GR, also called LR – lorry receipt) under which the returned goods were dispatched. One request creates one GR document in Logic ERP – a numbered list of the purchase returns sent together – and writes the transport details onto each return: transporter, GR number and date, vehicle, weight, cases, delivery place and times. This is what the Enter G.R. Details - Purchase screen (Purchase menu) does for purchase returns.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
Doc_PrefixstringOptional

Prefix of the GR document, for example "RGR". Stored in capitals. The document number is the next free number for this prefix in the branch (shared with GR documents for purchase vouchers and purchase challans) – you cannot choose it.

Doc_DatestringOptional

Date of the GR document, yyyy-MM-dd. A value that is not a date is replaced by today's date.

RemarksstringOptional

Remarks of the GR document.

BranchCodeintegerOptional

The branch of the returns (Branch_Code in Get Branch Info).

Responses
200

Always HTTP 200. Check Status and Message.

application/json
LastSavedDocNostringOptional

The GR document number: prefix and number joined by a hyphen, for example "RGR-5".

StatusbooleanOptional

true when the GR document was saved.

MessagestringOptional

"Success" when saved; otherwise the reason.

LastSavedCodeintegerOptional

Logic ERP's internal number of the GR document.

request_IDstringOptional

Always empty for this endpoint (see the known issue).

post/SaveGREntryAgainstPurchaseReturn
POST /api/SaveGREntryAgainstPurchaseReturn HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 243

{
  "Doc_Prefix": "APIRGR",
  "Doc_Date": "2026-10-30",
  "Remarks": "API TEST",
  "BranchCode": 2,
  "ListBills": [
    {
      "BillNo": "APITEST-PR-001",
      "GR_Number_1": "APITEST-RGR-001",
      "GR_Date_1": "2026-10-30",
      "Transport_Mode": "ROAD",
      "Cases": "1",
      "Doc_Remarks": "API TEST"
    }
  ]
}
{
  "LastSavedDocNo": "text",
  "Status": true,
  "Message": "text",
  "LastSavedCode": 1,
  "request_ID": "text"
}

Response

Field
Type
Meaning

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 "RGR-5".

request_ID

text

Always empty for this endpoint (see the known issue).

Example response

Messages you may see

Message
Meaning
What to do

Invalid Doc_Prefix....

Doc_Prefix is empty.

Send a prefix.

Unable to Retrive Bill No.…-… BranchCode : …

A return was not found, or BillNo matches several returns, in the branch and current financial year. The message shows the GRN prefix and number you sent (-0 when you sent only BillNo).

Check the bill number and branch.

A database error about an invalid column

GRN_Prefix / GRN_Number were sent (see the known issue).

Send BillNo only.

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 returns are already in another purchase-return GR document.

Leave them out.

Column 'Shipping_Label' does not belong to table .

ShippingLabel or TrackingUrl was sent.

Leave both out.

An item with the same key has already been added.

The same return appears twice in ListBills.

List each return once.

A message containing Branch_Short_Name : … not exists.

BranchShortName does not exist.

Check the short name.