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

Save Physical Verification of a Purchase Voucher

Records the physical verification of goods received against a purchase voucher. When the cartons arrive, the warehouse scans or counts what is actually inside, and Logic ERP keeps that count against each line of the voucher – the same count the Physical Stock Verification Of PUV screen (Inventory menu) records. Logic ERP compares it with the billed quantity: anything scanned that is not on the voucher, or more than the voucher quantity, goes into a difference list. The count is later used to raise debit notes to the supplier for goods short or for a higher rate charged – see Generate Rate Difference and Physical Stock Debit Notes. This endpoint creates no new document and does not change stock.

For goods received on a purchase challan, use Save Physical Verification of a Purchase Challan.

Endpoint

Name
Detail

Address

https://your-server/api/SavePhysicalVerificationPUV

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.

Request fields

Field
Type
Required
Default
Meaning

DocCode

number

One of the two

0

Logic ERP's internal number of the purchase voucher: Vouch_Code in Get Purchase Vouchers, or the LastSavedCode returned by Save a Purchase Voucher. Recommended. When it is above 0, PUV_Bill_No is not used and the branch is not checked. The voucher must belong to the current financial year; a number with no lines in that year is refused.

PUV_Bill_No

text

One of the two

empty

The supplier's bill number as entered on the purchase voucher (Bill_No in Get Purchase Vouchers). Used only when DocCode is 0. Only purchase vouchers are searched; a bill number found on more than one voucher is refused – send DocCode then.

BranchCode

number

With PUV_Bill_No

0

The branch of the voucher (Branch_Code in Get Branch Info). There is no branch short name field.

ListItems

list

Yes

–

What was scanned or counted, one entry per scan. See the table below. An empty or missing list is refused (also when every entry is skipped as -1).

Doc_Type

text

No

–

Ignored. The endpoint decides: this one always works on purchase vouchers.

ListItems

Field
Type
Required
Default
Meaning

LogicUser_Code

text

Yes

–

The code that was scanned. What it must contain depends on how your company counts purchases – see How the code is read below. An empty value stops the request. When the API template is set to ignore invalid items, entries whose code is -1 are skipped.

Quantity

number

Depends

0

How many were counted for this code. Used when counting by lot code or by item code (see below). When the configuration counts in packs, the number is multiplied by the units per pack of the matching voucher line.

AddlItemCode, Packing_Box_No, Item_Det_Code

–

No

–

Ignored. To scan an additional item code, send it in LogicUser_Code.

How the code is read

The API template names a configuration of the Physical Stock Verification Of PUV screen; that configuration decides how LogicUser_Code is read. Ask your Logic ERP team which one you use. If the voucher has already been counted (on the screen or through this endpoint), the method used for that earlier count is used again, whatever the configuration says.

Counting method

LogicUser_Code holds

Quantity

Lot code

The barcode printed on the lot label.

Send it. It is the number counted for that barcode; left out, nothing is counted. If the barcode also carries a piece number, that piece number is used as the quantity instead.

Lot code with piece number

The barcode of one piece.

Ignored – each barcode counts as one piece. A piece already counted is skipped.

Item code

The item code (UserCode in Get Item Master), or an additional item code when your company uses them. Upper/lower case must match the item code on the voucher; a code that differs only in case goes to the difference list.

The number counted. A value of 1 or less (or left out) counts as 1.

Lot number

The lot number.

The lot found is counted, as on the Physical Stock Verification Of PUV screen.

Set code / set name

The code or name of an item set.

Ignored – each item of the set is counted by its quantity in the set. A set that is not found is skipped without a message.

If the configuration has a lot code prefix, every LogicUser_Code must start with it; the prefix is removed before the code is read.

Rules Logic ERP applies

  • Which voucher. With DocCode, that document of the current financial year is used; it is not checked to be a purchase voucher, but a number with no lines in the current financial year is refused. With PUV_Bill_No, the purchase voucher of the current financial year (the year containing today's date on the server) in BranchCode with that bill number is used; when more than one voucher has it, the request is refused.

  • Configuration required. The API template must name a default configuration for this screen, otherwise nothing is saved.

  • Counts add up. Each request adds to what has already been counted for the voucher. Send each scan once; sending the same request twice counts the goods twice.

  • Matching. A scan is set against the voucher line with the same lot (or item) that still has quantity left. Codes not on the voucher, and quantities beyond the voucher quantity, go to the difference list.

  • Unknown codes. If the configuration does not allow invalid items and counting is by item code, a code that is not an item in Logic ERP stops the request.

  • When the count is refused. Nothing is saved if the voucher has already been used in a debit note for physical stock difference, or linked in the Receipt Register; if the configuration requires a minimum percentage to be scanned and less was scanned (counting every request so far); or if the configuration requires every voucher line to be scanned and a line still has nothing counted – the answer then names those items. The answer is Status: false with the reason.

  • Configurations the API cannot use. Counting by packing box, and the option that copies the voucher quantity into the physical quantity, are refused.

  • All or nothing. The counts for all lines and the difference list are saved together. If any scan is refused, nothing from the request is saved.

Known issue – missing voucher answered as success. If DocCode is 0 and PUV_Bill_No is empty, the answer is Status: true with the message Invalid Bill No. Please Check..., and nothing is saved. Always send DocCode or PUV_Bill_No.

Example request

Counting by item code:

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 counts the sandbox's test voucher; counts add up, so each send counts again.

Save Physical Verification of a Purchase Voucher

post

Records the physical verification of goods received against a purchase voucher. When the cartons arrive, the warehouse scans or counts what is actually inside, and Logic ERP keeps that count against each line of the voucher – the same count the Physical Stock Verification Of PUV screen (Inventory menu) records. Logic ERP compares it with the billed quantity: anything scanned that is not on the voucher, or more than the voucher quantity, goes into a difference list. The count is later used to raise debit notes to the supplier for goods short or for a higher rate charged – see Generate Rate Difference and Physical Stock Debit Notes. This endpoint creates no new document and does not change stock.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
BranchCodeintegerOptional

The branch of the voucher (Branch_Code in Get Branch Info). There is no branch short name field.

DocCodeintegerOptional

Logic ERP's internal number of the purchase voucher: Vouch_Code in Get Purchase Vouchers, or the LastSavedCode returned by Save a Purchase Voucher. Recommended. When it is above 0, PUV_Bill_No is not used and the branch is not checked. The voucher must belong to the current financial year; a number with no lines in that year is refused.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
StatusbooleanOptional

true when the count was saved. Read this field, not Message (see the known issues).

MessagestringOptional

"Physical Varification Done..." when saved; otherwise the reason.

LastSavedCodeintegerOptional

Always 0.

request_IDstringOptional

Always empty for this endpoint.

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

{
  "BranchCode": 2,
  "DocCode": 695,
  "ListItems": [
    {
      "LogicUser_Code": "APITEST0001",
      "Quantity": 4
    }
  ]
}
{
  "Status": true,
  "Message": "text",
  "LastSavedCode": 1,
  "request_ID": "text"
}

Response

Field
Type
Meaning

Status

true / false

true when the count was saved. Read this field, not Message (see the known issues).

Message

text

"Physical Varification Done..." when saved; otherwise the reason.

LastSavedCode

number

Always 0.

request_ID

text

Always empty for this endpoint.

Example response

Messages you may see

Message
Meaning
What to do

No Purchase Voucher Selected

No purchase voucher found for PUV_Bill_No in the branch and current financial year (not used for DocCode).

Check the number and BranchCode, or send DocCode.

Bill No. : … found multiple times. Please send DocCode...

More than one purchase voucher of the branch and year has that bill number.

Send DocCode.

No items found against DocCode : … in the current financial year...

DocCode has no lines in the current financial year.

Take DocCode from Get Purchase Vouchers for the current year.

No items to verify (ListItems is empty)...

ListItems is empty or missing, or every entry was skipped.

Send at least one scan.

Invalid Bill No. Please Check... (with Status: true)

Neither DocCode nor PUV_Bill_No was sent. Nothing was saved.

Send one of them.

Default Configuration Not Selected...

The API template has no configuration for this screen.

Ask your Logic ERP team to set it.

Cannot Allow Box No Scanning. Please check Physical Verification Of PUV Config...

The configuration counts by packing box.

Use a configuration without box scanning.

Cannot Move Voucher Quantity to Physical Quantity. Please check Physical Verification Of PUV Config...

The configuration copies the voucher quantity into the count.

Use a configuration without that option.

Barcode cannot be blank

An entry has an empty LogicUser_Code.

Send a code in every entry.

Invalid Item Code..

The code does not start with the configured lot code prefix.

Send the full code as printed.

Invalid Item Code.....: …

The item code does not exist in Logic ERP (item-code counting with invalid items not allowed).

Check the code.

Invalid Barcode...(…)

Piece counting: the barcode is not a lot-and-piece barcode.

Scan the piece label.

Lot Number does not exists / More than one Item exists against Lot

Lot-number counting: the lot number was not found, or belongs to several items.

Check the lot number.

This Purchase Voucher has been Retrieved in Purchase Return(Debit Note) for Physical Stock Difference.... Cannot Allow Change..., This Purchase Voucher has been Retrieved in Receipt Register.... Cannot Allow Change...

The voucher is already used in a physical-stock debit note or in the Receipt Register. Nothing was saved.

Check the voucher on the screen.

You must Scan minimum … (%) Physical Stock to Continue.....

Less than the configured percentage has been scanned so far. Nothing was saved.

Scan the rest and send it.

Physical Scaning not exists against following items :- …

The configuration requires every voucher line to be scanned, and some lines have nothing counted yet; the item and pack of each such line follow, one per line. Nothing was saved.

Scan those items and send them, or record the count on the screen.

Last updated