Read production order status and confirm a goods receipt for a production order in SAP S/4HANA using the OData v2 API (API_PRODUCTION_ORDER_2_SRV)
domain: api.sap.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Fetch the X-CSRF-Token by sending GET to /sap/opu/odata/sap/API_PRODUCTION_ORDER_2_SRV/ with header 'X-CSRF-Token: Fetch'; capture the token and cookie from the response headers.
Query production order status: GET /sap/opu/odata/sap/API_PRODUCTION_ORDER_2_SRV/A_ProductionOrderStatus_2?$filter=ManufacturingOrder eq '<order_number>' — key status fields include SystemStatus and UserStatus.
To post a production order confirmation, use the confirmation API: POST /sap/opu/odata/sap/API_PROD_ORDER_CONFIRMATION_2_SRV/A_ProdOrderConfirmation with a JSON body containing ManufacturingOrder, ConfirmationCount, ConfirmedYield, ConfirmedScrapQuantity, and ConfirmationText.
Include headers: Content-Type: application/json, X-CSRF-Token: <token>, and the session cookie returned from the fetch step.
Check the response for the created confirmation document number; HTTP 201 indicates success.
For batch confirmation of multiple orders, wrap multiple requests in an OData $batch envelope to reduce round-trips.
Known gotchas
API_PRODUCTION_ORDER_2_SRV and API_PROD_ORDER_CONFIRMATION_2_SRV are separate OData services — reading order status and posting confirmations require different service paths and potentially different OAuth scopes.
The X-CSRF-Token expires with the session; for long-running integration processes, re-fetch the token when a 403 Forbidden with 'Required' in the X-CSRF-Token response header is returned.
ConfirmedYield and ConfirmedScrapQuantity must be consistent with the base unit of measure on the order — passing values in an alternate UoM without conversion causes incorrect postings without an explicit error.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?