Post Lens Receiving (/lenses/receiving)

This endpoint allows an external system to post lens receivings against an Rx-Universe purchase order.

Inputs:

poNum - Rx-Universe purchase order number
OPC - OPC of the lens being received
qtyReceived - the number of lenses (not pairs) being received for this OPC
allowExcess - if set to Y, the endpoint will accept a quantity greater than what was ordered. If N, and a quantity received is submitted that is greater than the open quantity for the line (ordered - previously received), an error indicating this will be returned.
allowNewLens - if set to Y, the endpoint will accept an OPC that was not on the original PO. If set to N, and an OPC is submitted which was not on the original PO, it will be rejected and a message to that effect returned.

Additional functionality: - once all lenses have been received for a particular lens, that lens will be marked closed on the purchase order, even if there are multiple receivings.

Once all lenses have been received for the purchase order, the PO will be marked closed.

Response:

For a successful submission, the response indicates what was marked received:

{ "poNum": "string", "stockNum": "string", "stock-num": "string", "stock-description": "string", "opc": "string", "lensesReceived": "string" }

If the submission cannot be processed, the response will indicate the reason in the following format:

{ "dis error": "PO number 00024631 could not be found" }

The messages that could be returned are:

“PO number xxxxxxx” could not be found” - the specified purchase order does not exist
”Could not open xxxxxxxx file fs:” - if one of the tables can not be accessed, the specific file will be listed along with the file status (following the fs:)
”specified OPC not found” - the OPC that was submitted could not be found in Rx-Universe
”lens record not found” - the OPC was recognized, but the lens associated with it is not active in Rx-Universe
”specified lens not on this PO” - the OPC submitted was recognized, but the lens associated with that OPC was not on the purchase order, and the option to accept lenses not on the PO was not set.
”qty received more than qty ordered” - this is returned when the option to receive excess quantity is not active, and the quantity received would result in more lenses received than were originally ordered