# Check Receive Status of a Purchase Order Reports the most recent receive started against this purchase order. status is one of: - pending while lines are still being applied. Keep polling. - completed once every line went through. - failed if any of them did not. The line ids are grouped by what happened to them. Every id you sent appears in exactly one of the three, so together they account for the whole request: - received_line_item_ids for the lines that were applied - pending_line_item_ids for those the receive has not applied - errors for the ones that failed, each with its reason Two things worth knowing: - A failed receive can carry ids in pending_line_item_ids with errors empty. That is a receive that fell over before it reached those lines rather than one that rejected them, and error carries the reason. Nothing on those lines was applied. - Records are kept once a receive finishes, so this keeps reporting the last one. It returns 404 only until something has been received against the order for the first time. Endpoint: GET /api/v1/purchase_orders/{purchase_order_id}/receive/status Security: BearerAuth ## Path parameters: - `purchase_order_id` (number, required) ID of the purchase order Example: "506" ## Header parameters: - `Accept` (string) e.g. application/json Example: "application/json" - `Authorization` (string) e.g. Bearer Example: "Bearer " ## Response 200 fields (application/json): - `data` (object) - `data.status` (string) pending while lines are still being applied, completed once all of them went through, failed if any did not. - `data.received_line_item_ids` (array) Lines that were received - `data.pending_line_item_ids` (array) Lines the receive has not applied. While status is pending they are still to come. If status is failed they were never applied and never will be: the receive stopped before reaching them, and error says why. Stop polling on status, not on this list emptying. - `data.errors` (array) Lines that failed, each with its reason - `data.errors.line_item_id` (number) - `data.errors.name` (string,null) Name of the item on the line, to save looking it up - `data.errors.error` (string) What went wrong, in words. Meant for a person reading it, so do not match on the text; it can change. - `data.error` (string,null) Set when the receive as a whole failed rather than particular lines, in which case errors is empty. - `data.created_at` (string) When the receive was started - `data.updated_at` (string) When it last changed, which is the time it finished once it has ## Response 401 fields (application/json): - `message` (string) - `errors` (object,null) Field-level messages, present only on some validation failures ## Response 402 fields (application/json): - `message` (string) - `errors` (object,null) Field-level messages, present only on some validation failures ## Response 404 fields (application/json): - `message` (string) - `errors` (object,null) Field-level messages, present only on some validation failures