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

Save a Purchase Return Journal Voucher

Saves a purchase return journal voucher – a journal voucher in Logic ERP's Purchase Return day book (PR - PURCHASE RETURN). Use it to record goods sent back to a supplier, or a reduction of a purchase, that is not entered as a Logic ERP purchase return: the supplier is debited, and the purchase, expense or fixed-asset account and the GST input tax accounts are credited. The supplier's line becomes an open debit of the supplier. No stock moves. The debits must equal the credits.

The other journal-voucher endpoints: Save a Journal Voucher, Save a Sale Journal Voucher, Save a Sale Return Journal Voucher, Save a Purchase Journal Voucher, Save a Credit Note, Save a Debit Note. Money received or paid in cash or through a bank: Save a Cash Receipt, Save a Cash Payment, Save a Bank Receipt, Save a Bank Payment.

Endpoint

Name
Detail

Address

https://your-server/api/SaveJVPurchaseReturn

Method

POST

Authorization

Basic Auth

The response envelope, branches, dates, queueing and the common messages are explained in How Every API Call Works.

Request fields

Field names are not case-sensitive. Codes and names are matched as you send them; capitals do not matter, but do not put spaces in front.

Field
Type
Required
Default
Meaning

BranchCode

number

No – but always send it (or BranchShortName)

0

The branch the voucher belongs to, by Logic ERP's branch number (Branch_Code in Get Branch Info). It also decides which settings of your API site are used.

BranchShortName

text

No

empty

The branch by its short name; used only when BranchCode is 0 or less (NIL means branch 0). With neither, the request runs for branch 0, which normally has no settings for this endpoint, so it is refused with the Configuration not Set message.

Doc_Date

date

No

today

The voucher date, yyyy-MM-dd. It also decides the financial year the voucher is saved in. A value that is not a date is refused.

Bill_No

text

No

the series name, - and the voucher's number in the series, for example JU-57

The bill or reference number of the voucher, up to 25 characters. It is also the reference of the party lines (see Bills and adjustment).

Bill_Date

date

No

none

The date of that bill, yyyy-MM-dd. Saved as the voucher's bill date, used as the due date of every line and written into the default narration. Without it the due date is the voucher date.

PartyUserCode

text

No

empty

A party code (User_Code in Get Party Master). When sent, it must match exactly one account or the request is refused – but it is only checked, not saved. The voucher's party always comes from ListAccounts.

GR_No

text

No

empty

A goods-receipt or transport document number, up to 25 characters.

GR_Date

date

No

none

The date of GR_No, yyyy-MM-dd. Saved as the voucher's GR date when GR_No is sent; a value that is not a date is ignored.

Remarks_1, Remarks_2

text

No

empty

Remarks 1 and 2 of the voucher, up to 30 characters each. Spaces at either end are removed.

TranspoterName, AgentName

text

No

–

Accepted but ignored.

ListAccounts

list

Yes

empty list

The debit and credit lines of the voucher – see below.

ListAccounts – one entry per debit or credit line

Field
Type
Required
Default
Meaning

PartyUserCode

text

Yes

–

The account of the line, by the account code shown in Logic ERP (for a customer or supplier, User_Code in Get Party Master). Any account can be used – customer, supplier, sale, purchase, income, expense, fixed asset, GST tax, cash, bank or any other ledger. The account's type is not checked here, but it decides the rules below.

DebitOrCredit

text

Yes

–

DR to debit the account, CR to credit it. Capitals only: dr or Dr is refused.

Amount

number

Yes

0

The amount of the line in rupees, above 0; the side comes from DebitOrCredit. A zero or negative amount is refused.

Narration

text

No

Bill No. + your Bill_No + Dated: + Bill_Date as dd/mm/yyyy

The narration of the line, up to 250 characters. The default uses Bill_No and Bill_Date as you sent them, so with neither it reads Bill No. Dated:.

HS_Code

text

No – unless the configuration makes it compulsory

empty

The HSN or SAC code of the line, as in Logic ERP's HSN master. When sent it must exist. Saved on the line.

Cost_Center, Cost_Element

text

No

empty

A cost centre and a cost element, by name. Send both: the pair must be linked in Logic ERP's cost-centre setup. The line is booked to that cost centre.

Quantity

number

No

0

A quantity, saved on the line for information.

CompanyName

text

No

empty

A company from Logic ERP's company master, by name. Checked but not saved – see the known issue below.

Txn_Category

text

No

empty

A transaction category, by name. Checked but not saved – see the known issue below.

EmployeeName

text

No

empty

An employee from Logic ERP's employee master, by name (or by the employee's number). When sent it must exist. Saved on the line.

Rules Logic ERP applies

  • What is saved. A journal voucher in the Purchase Return day book, with one line for each entry of ListAccounts; each line is posted to its account's ledger on the side you send.

  • A purchase, expense or fixed-asset account is required. At least one line must use a purchase, expense or fixed-asset account, or the request is refused.

  • The party is debited. Customer, supplier, cash and bank lines together may not add up to a credit, or the request is refused.

  • More than one party is allowed. Unlike a credit note, a debit note or a sale return journal voucher, this voucher may use several customer or supplier accounts, and no pending note record is kept for the party.

  • Settings. Your API site's settings for this endpoint and for the branch must name a journal voucher configuration (the list there offers only configurations made for purchase return journal vouchers) and a series; without a configuration the request is refused. The configuration decides how the voucher is numbered, whether bill numbers must be unique and whether HSN codes are compulsory. The settings' Ignore Invalid Item option has no effect.

  • Accounts. Each line's PartyUserCode is looked up among all of Logic ERP's accounts; a code that is not found stops the request. An account may appear on more than one line. The voucher's party is the account of the first customer, supplier, debtor or creditor line; without one, Logic ERP takes an asset or liability line, or else the only debit or credit line.

  • Debits must equal credits. The DR amounts and the CR amounts must add up to exactly the same total, to the paisa, or nothing is saved. Logic ERP adds no rounding or balancing line.

  • GST. Logic ERP does not work out GST. To record GST, add the GST tax accounts as lines of their own with the tax amounts. Every GST tax account used must have its tax % set in the account master. When the customer, supplier, cash and bank lines do not add up to zero, Logic ERP also checks the tax lines: CGST and SGST lines must come in pairs with equal amounts (in total and for each tax %), CGST/SGST and IGST cannot be mixed, and the tax type must suit the party (CGST/SGST for a party in the branch's state, IGST for another state). Reverse-charge GST accounts are refused in such a voucher, because a voucher sent through the API cannot be marked as reverse charge. Sale and purchase accounts can never be used in the same voucher. GST input-service-distributor (ISD) tax accounts can be used only in a branch set up as an ISD branch, and not together with normal GST tax accounts.

  • HSN codes. When the JV configuration makes HSN codes compulsory, every line except customer and supplier lines – the GST tax lines too – needs an HS_Code.

  • TDS. No TDS is deducted, even when an account is linked to a TDS type in Logic ERP. If you need TDS, send it as lines of its own.

  • Bills and adjustment. Each debited line of a customer, supplier, debtor, creditor or cash account is recorded as an open debit of that account, with Bill_No as its reference and Bill_Date (or the voucher date) as its due date. Logic ERP does no bill-wise adjustment on this endpoint: the voucher is not set off against any existing bill, receipt or payment. Make the adjustment in Logic ERP afterwards. No items or stock are involved.

  • Numbering. The voucher gets the next number of the series in the branch and financial year, so numbering starts again each year. If that number has more digits than the series' bill-number length allows, the request is refused. Logic ERP also gives the voucher its voucher number, built as the configuration says: by default JV, the voucher date (yyyyMMdd) and a running number for that day in the branch, for example JV202611053 for the third voucher of 5 November 2026 (the running number is not padded with zeros); when the configuration sets its own voucher numbering, JV, the voucher prefix, the date part the configuration chooses (for example the year and month) and a running number, for example JVJU-2611-2. When the series has a description or a financial-year setting, a printed voucher number is formed too, for example 26-27/JU-57.

  • Date and financial year. Doc_Date decides the financial year; a date no financial year covers is refused (see How Every API Call Works). The request is also refused when the date is after today and the Logic ERP user linked to your API site may not make post-dated journal entries, when the date is on or before that user's lock date, or when that user's back-date lock schedule locks the period.

  • Duplicates. If the JV configuration asks for unique bill numbers, a Bill_No already used by another voucher of the same day book in the branch and financial year is refused (another document); if it asks for unique bill numbers per party, a Bill_No already used for the same party is refused (another supplier). Otherwise there is no duplicate check: every request that succeeds saves a new voucher. Check Status before you resend.

  • All or nothing. The voucher and all its lines are saved together. If anything fails, nothing is saved.

  • Switching off. Your support team can switch this endpoint off per branch. Then nothing is saved and the answer has Status: true with the In-Active sentence in Message (as explained in How Every API Call Works).

  • Your Logic ERP licence must include the API for journal purchase return vouchers.

Known issue – CompanyName and Txn_Category are checked but not saved. A name that does not exist is refused, but a valid one is not stored on the line. Leave them empty unless you only want the check.

Known issue – an apostrophe in Bill_No can stop the request. When the JV configuration asks for unique bill numbers, an apostrophe (') in Bill_No makes the request fail with a technical error. Do not use apostrophes in Bill_No.

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: each send saves a new purchase return journal voucher of ₹7.50 that debits the test party APITESTS01 and credits the expense account 290. Change Bill_No each time (for example APITEST-JV-7), set Doc_Date and Bill_Date to today's date, and keep the small amounts and the "API TEST" values.

Save a Purchase Return Journal Voucher

post

Saves a purchase return journal voucher – a journal voucher in Logic ERP's Purchase Return day book (PR - PURCHASE RETURN). Use it to record goods sent back to a supplier, or a reduction of a purchase, that is not entered as a Logic ERP purchase return: the supplier is debited, and the purchase, expense or fixed-asset account and the GST input tax accounts are credited. The supplier's line becomes an open debit of the supplier. No stock moves. The debits must equal the credits.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
BranchCodeintegerOptional

The branch the voucher belongs to, by Logic ERP's branch number (Branch_Code in Get Branch Info). It also decides which settings of your API site are used.

BranchShortNamestringOptional

The branch by its short name; used only when BranchCode is 0 or less (NIL means branch 0). With neither, the request runs for branch 0, which normally has no settings for this endpoint, so it is refused with the Configuration not Set message.

Doc_DatestringOptional

The voucher date, yyyy-MM-dd. It also decides the financial year the voucher is saved in. A value that is not a date is refused.

Bill_NostringOptional

The bill or reference number of the voucher, up to 25 characters. It is also the reference of the party lines (see Bills and adjustment).

Bill_DatestringOptional

The date of that bill, yyyy-MM-dd. Saved as the voucher's bill date, used as the due date of every line and written into the default narration. Without it the due date is the voucher date.

PartyUserCodestringOptional

A party code (User_Code in Get Party Master). When sent, it must match exactly one account or the request is refused – but it is only checked, not saved. The voucher's party always comes from ListAccounts.

GR_NostringOptional

A goods-receipt or transport document number, up to 25 characters.

GR_DatestringOptional

The date of GR_No, yyyy-MM-dd. Saved as the voucher's GR date when GR_No is sent; a value that is not a date is ignored.

TranspoterNamestringOptional

Accepted but ignored.

AgentNamestringOptional

Accepted but ignored.

Remarks_1stringOptional

Remarks 1 and 2 of the voucher, up to 30 characters each. Spaces at either end are removed.

Remarks_2stringOptional

Remarks 1 and 2 of the voucher, up to 30 characters each. Spaces at either end are removed.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
LastSavedDocNostringOptional

The voucher number, the day-book code (PR) and the voucher's number in the series, joined by -, for example JVJU-2611-2-PR-57. null when not saved.

LastSavedVouchNostringOptional

The printed voucher number formed from the series settings, for example 26-27/JU-57; empty when the series forms none. null when not saved.

LastSavedBillNostringOptional

The bill number saved on the voucher – your Bill_No, or the default one. null when not saved.

ErrorCodestringOptional

A number for some refusals (shown in the table below, for example 220003); otherwise empty.

StatusbooleanOptional

true when the voucher was saved.

MessagestringOptional

Success when saved; otherwise the reason.

LastSavedCodeintegerOptional

Logic ERP's internal number of the new voucher; 0 when not saved.

request_IDstringOptional

The ID of this request – quote it to support. null when the endpoint is switched off for the branch (the In-Active answer); empty when the request is refused before it reaches this endpoint (see below).

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

{
  "BranchCode": 2,
  "BranchShortName": "",
  "Doc_Date": "2026-11-11",
  "Bill_No": "APITEST-JV-5",
  "Bill_Date": "2026-11-11",
  "PartyUserCode": "",
  "GR_No": "",
  "GR_Date": "",
  "TranspoterName": "",
  "AgentName": "",
  "Remarks_1": "API TEST",
  "Remarks_2": "",
  "ListAccounts": [
    {
      "PartyUserCode": "APITESTS01",
      "Amount": 7.5,
      "DebitOrCredit": "DR",
      "Narration": "API TEST",
      "CompanyName": "",
      "HS_Code": "",
      "EmployeeName": "",
      "Cost_Center": "",
      "Cost_Element": "",
      "Quantity": 0,
      "Txn_Category": ""
    },
    {
      "PartyUserCode": "290",
      "Amount": 7.5,
      "DebitOrCredit": "CR",
      "Narration": "API TEST",
      "CompanyName": "",
      "HS_Code": "64029190",
      "EmployeeName": "",
      "Cost_Center": "",
      "Cost_Element": "",
      "Quantity": 0,
      "Txn_Category": ""
    }
  ]
}
{
  "LastSavedDocNo": "text",
  "LastSavedVouchNo": "text",
  "LastSavedBillNo": "text",
  "ErrorCode": "text",
  "Status": true,
  "Message": "text",
  "LastSavedCode": 1,
  "request_ID": "text"
}

Response

Field
Type
Meaning

Status

true / false

true when the voucher was saved.

Message

text

Success when saved; otherwise the reason.

ErrorCode

text

A number for some refusals (shown in the table below, for example 220003); otherwise empty.

LastSavedCode

number

Logic ERP's internal number of the new voucher; 0 when not saved.

LastSavedDocNo

text

The voucher number, the day-book code (PR) and the voucher's number in the series, joined by -, for example JVJU-2611-2-PR-57. null when not saved.

LastSavedVouchNo

text

The printed voucher number formed from the series settings, for example 26-27/JU-57; empty when the series forms none. null when not saved.

LastSavedBillNo

text

The bill number saved on the voucher – your Bill_No, or the default one. null when not saved.

request_ID

text

The ID of this request – quote it to support. null when the endpoint is switched off for the branch (the In-Active answer); empty when the request is refused before it reaches this endpoint (see below).

When a request is refused before it reaches this endpoint (for example an unknown BranchShortName, or a Doc_Date no financial year covers), the answer has only Status, Message, LastSavedCode and request_ID.

Example response

Messages you may see

The reason may be followed by technical detail – read the first line.

Message
Meaning
What to do

Journal Voucher - Configuration not Set in API Template for Branch Code: …

Your API site's settings for this endpoint name no journal voucher configuration for this branch (the branch number is shown).

Ask your Logic ERP team to choose the configuration and series for the branch, or send the right branch.

Invalid header Party User Code... :…

The header PartyUserCode is not found.

Send an existing party code, or leave it empty – it is not saved anyway.

Invalid Doc_Date : …

Doc_Date is not empty and not a date.

Send yyyy-MM-dd, or leave it out for today.

Post Dated enteries are not allowed.......

Doc_Date is after today and the API site's Logic ERP user may not make post-dated journal entries.

Send today's date or an earlier one.

Entry/Modification is locked for this period....

The back-date lock schedule of the API site's Logic ERP user locks Doc_Date.

Send a later date or ask your Logic ERP team.

Modification rights not available for this date.....

Doc_Date is on or before the lock date of the API site's Logic ERP user.

Send a later date or ask your Logic ERP team.

Invalid Accounts Details PartyUserCode.. : (followed by a space, nothing else)

A line has an empty PartyUserCode. ErrorCode 220002.

Send the account code on every line.

Unable to found PartyUserCode : …

No account has the code of a line. ErrorCode 220003.

Send the code exactly as in Logic ERP.

ListAccounts is required

ListAccounts is empty or null.

Send at least one line.

Debit/Credit not defined...

A line's DebitOrCredit is not DR or CR in capitals.

Send DR or CR.

Invalid Amount against PartyUserCode : …

A line has Amount 0 or less (the code shown is that line's PartyUserCode).

Send an amount above 0.

Unable to found TXN Category : …

Txn_Category is not found. ErrorCode 220004.

Send an existing name or leave it empty.

Unable to found HS_Code : …

HS_Code is not in the HSN master. ErrorCode 220005.

Send an existing HSN / SAC code.

HSN Code is mandatory.....

The JV configuration makes HSN codes compulsory and a line other than a customer or supplier line has no HS_Code. ErrorCode 220006.

Send HS_Code on every such line.

Unable to found Company Name : …

CompanyName is not found. ErrorCode 220007.

Send an existing name or leave it empty.

Unable to found Employee Name : …

No employee has that name (or number). ErrorCode 220008.

Send the name exactly as in Logic ERP, or leave EmployeeName empty.

Unable to found Cost_Center : … Or Cost_Element :…

The cost centre and cost element are not found as a linked pair (also when only one of them is sent). ErrorCode 220009.

Send both names exactly as in Logic ERP, or neither.

This Bill No. already exists for another document....

The JV configuration asks for unique bill numbers and Bill_No is already used in this day book.

Send another Bill_No.

This Bill No. already exists for another supplier....

The JV configuration asks for unique bill numbers per party and Bill_No is already used for this party.

Send another Bill_No.

Debit/Credits are not equal

The DR total and the CR total differ.

Make the totals equal.

No Purchase/Fixed Asset/Expense A/c Exist in this Voucher....... Please Check.

No line uses a purchase, expense or fixed-asset account.

Add that line.

Party Account cannot be Credited in case of Debit Note

Customer, supplier, cash and bank lines add up to a credit (the message says Debit Note on this endpoint too).

Debit the party.

Tax(%) for account … not defined in masters. Define Tax(%) in accounts master.

A GST tax account used has no tax %.

Ask your Logic ERP team to set it, or use another account.

Both Sale and Purchase accounts cannot be used in the same document.

The voucher has a sale and a purchase account.

Split it into separate vouchers.

CGST/SGST and IGST cannot be allowed in the same document.

CGST/SGST and IGST lines are mixed.

Use one kind of tax only.

CGST and SGST accounts do not match. or CGST and SGST amounts do not match.

The CGST and SGST lines are not in pairs, or their totals differ.

Send a CGST line and an SGST line of the same amount.

CGST and SGST amounts of Tax(%) … accounts do not match.

For one tax %, the CGST and SGST totals differ.

Make them equal for each tax %.

Party GST Type and Document GST Type does not match,Please check.

CGST/SGST was used for a party in another state, or IGST for a party in the branch's state.

Use the tax type that suits the party.

This branch is not configured as an ISD branch. ISD-GST document creation is not allowed., or another message about ISD

An input-service-distributor (ISD) GST tax account is used in a branch that is not an ISD branch, or together with normal GST accounts, or its CGST and SGST lines do not match.

Leave ISD tax accounts out, or ask your Logic ERP team.

Reverse charge accounts exist in this document but Reverse Charge not selected for this document.

A reverse-charge GST account is used; the API cannot mark the voucher as reverse charge.

Leave reverse-charge accounts out, or enter the voucher in Logic ERP.

Bill No Length Is greater than length defined in bill series settings (followed by a space)

The voucher's number in the series has more digits than the series allows.

Ask your Logic ERP team to check the series.

"Status": false with The operation was canceled.

Saving stopped inside Logic ERP without a reason. Nothing was saved.

Retry once; if it repeats, send the request_ID to support.

Another technical error

Saving failed inside Logic ERP; nothing was saved.

Retry once; if it repeats, send the request_ID to support.

Last updated