Generate Accounting Transaction (MO)
POST/api/manufacturing/manufacturing-orders/:id/generate-accounting-transaction
Generate (or rebuild) the WIP-routed GL journals for this MO — ONE journal per production iteration, each dated to that iteration's production date (so multi-day / multi-period production is period-accurate). Conversion costs (labor + overhead + outsourced service) are capitalized into finished goods through Work In Process:
manufacturing:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
- Dr Work In Process (total)
- Cr Raw Materials Inventory (materials), Cr Direct Labor Applied (labor), Cr Manufacturing Overhead Applied (overhead), Cr Accrued Purchases (outsourced service fee)
- Dr Finished Goods Inventory (total), Cr Work In Process (total)
WIP nets to zero. Each journal links polymorphically to the MO and is tagged with its mo_production_iteration_id. Requires the Work In Process / Direct Labor Applied / Manufacturing Overhead Applied nominal codes to be mapped (Settings -> Nominal Code Mappings). No request body. Returns an ARRAY of accounting transaction object (one per iteration) with their journal lines. Each iteration's journal is also posted automatically as production is recorded (when accounting is enabled), and removed if the iteration is reversed.
Request
Responses
- 200
- 401
- 403
- 404
- 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.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
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.