A purchase order ends at physical reception. It can have several receptions and becomes received when all the merchandise has arrived. From there, the merchandise's progress inside the branch (quality control, release to sale, scrap) belongs to inventory: the order does not store it. Query it in Receipts and receiving tray.
When receiving, Fenicia records the reception on the order and then hands the merchandise to inventory, with the order's identifier as the source and the reception number as the sequence. Retrying the same reception does not duplicate the reception or the lots.
400The order is in another currency and the request has no fxRate, or batchNumber or expirationDate is missing for a variant that requires it.
{ "code": "validation-error", "message": "La orden está en USD: envía el tipo de cambio del día (fxRate)" }
404The order does not exist in your tenant.
{ "code": "not-found", "message": "Purchase order not found" }
Returns the updated order, the prorated cost per SKU in proratedItems (already in the tenant's currency) and the inventory field, which says where the merchandise went.
Lines received. If the variant requires traceability, split the quantity into one line per manufacturer batch: repeat the sku with its batchNumber and expirationDate.
items.skustringrequired
SKU of the order line.
items.receivednumberrequired
Accepted pieces. They enter inventory.
items.rejectednumberrequired
Pieces rejected at the door (broken, wrong). They do not enter inventory or count as received: the order stays partial until the supplier replaces them as another reception. Scrap happens later, inside the receiving flow.
items.rejectionReasonstring
Reason for the rejection.
items.batchNumberstring
Manufacturer batch. Required if the variant has inventoryTracking.trackBatches.
items.expirationDatestring
Expiration date, ISO 8601. Required if the variant has inventoryTracking.trackExpiration.
fxRatenumber
Same-day exchange rate from the order's currency to the tenant's currency. Required if the order's currency is not the tenant's: without it the reception is rejected and never produces a cost. Each line has the line discount subtracted and the result is converted with this rate.
Returned values: flow (the merchandise is in the first stage of the branch's flow, in process), stock (the branch has no flow and the merchandise raised sellable stock on reception) or erp (an ERP governs the stock: the reception does not change inventory).
If inventory fails, the error is propagated in the response: the reception is not silently treated as good.
400The order has no receptions, or it is already cancelled or received.
{ "code": "validation-error", "message": "La orden no tiene recepciones: cancélala en vez de cerrarla con faltante" }
Returns the order in received status with the shortfall per line in shortfall.
It is not a cancellation: the order did have receptions, and the receptions and lots that already entered are kept. What was received and rejected so far does not change.
400The quantity exceeds what is left in the lot or in the branch's stock.
{ "code": "validation-error", "message": "La cantidad excede la existencia del lote lot_01J9C" }
Returns the pieces removed with each one's lot and cost. The merchandise leaves stock and the lot, and stays linked to the purchase order.
A supplier return is not scrap: the cost is expected to be recovered. If the supplier replaces the merchandise, it enters as a new reception of the same order.