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. See the known issue below.

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. See the known issue below.

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

No

empty

What was scanned or counted, one entry per scan. See the table below. An empty list changes no count but is still answered as saved.

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.

See the known issue below – nothing is counted.

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. With PUV_Bill_No, the first purchase document of the current financial year (the year containing today's date on the server) in BranchCode with that bill number is used.

  • 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; or if the configuration requires a minimum percentage to be scanned and less was scanned (counting every request so far). (See the first known issue – the reason is not returned.)

  • 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 – a refused count is answered "Physical Varification Done...". When the count is refused at the saving step (voucher already in a physical-stock debit note or in the Receipt Register, too little scanned, or a save error), the answer is Status: false with the message Physical Varification Done... – the real reason is lost. Always read Status, not Message; if it is false with this message, check the voucher on the Physical Stock Verification Of PUV screen.

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.

Known issue – an unknown DocCode is accepted. DocCode is not checked: a number that is not a document of the current financial year (for example a voucher from an earlier year) is answered Status: true, and every scan is saved to the difference list of that number. Take DocCode from Get Purchase Vouchers for the current year.

Known issue – the "scan every line" option has no effect. A configuration that requires every voucher line to be scanned before saving is not applied by this endpoint: a count with unscanned lines is saved. Check unscanned lines on the Physical Stock Verification Of PUV screen.

Known issue – PUV_Bill_No can pick the wrong document. The bill number is looked up among all purchase documents of the branch – purchase vouchers, purchase returns and others – and the first one found is used. Supplier bill numbers often repeat. Use DocCode instead.

Known issue – counting by lot number saves nothing. When the configuration counts by lot number and the voucher has not been counted before, the lot is found but no quantity is recorded; the request still succeeds and every line is saved as counted with zero – so a later physical stock debit note would cover the whole voucher. Count by lot code or item code instead, or record the count on the screen.

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. See the known issue below.

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. Unexpected errors return technical text with the reason in it.

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. Unexpected errors return technical text with the reason in it.

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 document found for PUV_Bill_No in the branch and current financial year (not used for DocCode).

Check the number and BranchCode, or send DocCode.

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.

Physical Varification Done... with Status: false

The count was refused when saving; the reason is not shown (see the first known issue).

Check the voucher on the screen.

Last updated