Preview Bulk Submit Purchase Orders
POST/api/purchase-orders/submit/preview
Preview what a bulk submit would do to the selected purchase orders before running it: which orders are email-format (their supplier is emailed immediately on submit) and which are Manual-format (marked Finalized without emailing). Orders that are not open are counted as ineligible and skipped by the bulk submit.
Authentication: Requires Bearer token.
Body (one of ids, filters, or apply_to_all is required):
- ids[]: Array of purchase order IDs (required without
filters/apply_to_all) - filters: Spatie filter params (required without
ids/apply_to_all) - apply_to_all (boolean, optional): Targets every purchase order matching the active
filtersinstead of an explicitidslist. Send{"apply_to_all": true, "filters": {}}to target every purchase order.
Response fields:
- email_count (integer): Open orders whose submission format emails the supplier on submit
- manual_count (integer): Open Manual-format orders (finalized without emailing)
- ineligible_count (integer): Selected orders that are not open and will be skipped
- email_orders[] (array): The email-format orders — purchase_order_number and supplier_name
Requires permission: purchase_orders.approve
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.