Best practices for designing sustainability APIs to expose carbon footprint data

We’re building custom REST APIs to expose product carbon footprint and sustainability metrics from SAP PLM 2020 to external reporting systems and partner portals. I’m looking for experiences around key design decisions.

Should we expose raw material-level data or pre-aggregated product totals? How do you handle API versioning when carbon calculation methodologies evolve? What’s the right approach for maintaining audit trails when external systems consume this data?

Our sustainability management module tracks emissions across the entire product lifecycle, and we need APIs that balance flexibility for analytics with compliance requirements for immutable reporting. Would love to hear how others have approached this.

SAP PLM 2020 ↔ External Systems — Carbon Footprint API Design


Granularity: Raw vs. Aggregated

Expose both, but as distinct endpoints. Analytics consumers (BI tools, partner portals) need product-level aggregates; compliance auditors need traceable material-level decomposition. A single fat response creates coupling you’ll regret when calculation methodologies change.

Recommended resource structure:

GET /v1/products/{productId}/carbon-footprint
  → aggregated PCF (Product Carbon Footprint), methodology version, calculation timestamp

GET /v1/products/{productId}/carbon-footprint/components
  → per-material emission factors, lifecycle phase breakdown (cradle-to-gate, gate-to-grave)

GET /v1/products/{productId}/carbon-footprint/audit
  → immutable calculation record, source BOM version, EH&S master data snapshot IDs

In PLM 2020, sustainability metrics surface through the Sustainability Management workset and underlying EH&S substance/specification objects. Your API layer (typically SAP Integration Suite / CPI or a custom Java/Node middleware) pulls from these objects via RFC or OData — verify whether your landscape exposes /sap/opu/odata/sap/ sustainability-specific OData services or requires custom ABAP extraction (verify in your version).


API Versioning for Evolving Methodologies

URI versioning (/v1/, /v2/) is insufficient alone when the semantics of a carbon value change (e.g., switching from GWP100-AR5 to AR6 factors). Embed methodology metadata in every response payload:

{
  "productId": "MAT-00421",
  "pcf_kgCO2e": 14.72,
  "methodology": {
    "standard": "ISO 14067",
    "gwp_basis": "IPCC AR6",
    "version_id": "METH-2024-03",
    "effective_date": "2024-03-01"
  },
  "calculation_run_id": "CR-20240615-0891"
}

Consumers must store version_id alongside consumed values — not just the number. When methodology changes, increment version_id, keep prior endpoint versions alive for a defined deprecation window (minimum one reporting cycle), and emit a Sunset HTTP header.


Audit Trail and Immutability

This is the highest-risk area. External consumption of a mutable record is a compliance gap. Implement these controls:

  • Freeze on publish: When a PCF record is exposed externally, write an immutable snapshot to a separate audit store (database table or document store). Never serve live calculation results directly to compliance endpoints.
  • calculation_run_id must be a durable, externally resolvable key — partner portals should be able to call GET /v1/audit/runs/{runId} and retrieve the exact inputs used.
  • Log every API call against compliance endpoints (transaction SM58 / application log on the SAP side, API gateway access logs on the middleware side) with consumer identity, timestamp, and payload hash.
  • If using SAP Integration Suite, activate message processing log persistence and set retention to exceed your regulatory obligation period.

Version Compatibility

PLM 2020 OData service availability and EH&S integration depth differs from S/4HANA-embedded PLM — verify which sustainability OData services are activated in SOAMANAGER and whether BAdI SUSM_* extension points are available for your specific support package level before committing to extraction patterns.


This draft is based on general SAP PLM knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

We expose both raw and aggregated data through separate endpoints. Raw material data goes to internal analytics teams who need granular analysis, while aggregated product-level metrics serve external compliance reporting. This dual approach adds complexity but gives you flexibility. For versioning, we use URI versioning (/v1/, /v2/) rather than header-based, making it explicit which calculation methodology is being used.

Audit trail is critical for sustainability data. Every API response should include metadata about calculation method version, data collection timestamp, and certification status. We implement this as response headers plus a separate audit log endpoint. When external systems query carbon data, we log the request, response snapshot, and consuming system identity. This creates an immutable record for compliance audits. Also consider rate limiting and authentication to control who accesses sensitive sustainability metrics.

For API versioning with evolving methodologies, we implemented a hybrid approach. The API version indicates the interface contract (fields, structure), while a separate calculation-version parameter in the request specifies which carbon calculation standard to apply (GHG Protocol 2019, ISO 14067:2018, etc.). This lets clients explicitly request data under specific methodologies for comparison purposes. New calculation methods don’t break existing API integrations.

Raw versus aggregated is really about your use cases. We found that exposing raw material-level emissions data created problems because external partners started doing their own calculations and getting different results. Now we only expose certified aggregated values through the API, with detailed breakdowns available through a separate authenticated endpoint for internal use. This prevents discrepancies in external reporting while maintaining transparency for authorized users.

Don’t forget about temporal aspects. Carbon footprint data changes as suppliers update their processes or as you switch materials. Your API should support time-based queries so consumers can retrieve historical snapshots. We use effective-date parameters in our requests and maintain versioned sustainability records in SAP PLM. This is essential when partners need to report carbon data for products manufactured months or years ago under different supply chain conditions.

Having designed sustainability APIs for three major SAP PLM implementations, here’s my perspective on the key considerations:

Raw vs. Aggregated Data Exposure: Implement a tiered API strategy. Expose aggregated product-level carbon totals as your primary public API - this ensures consistency in external reporting and prevents calculation discrepancies. Create a separate authenticated API for raw material-level data, restricted to internal analytics and authorized partners. Include aggregation metadata (calculation method, component count, data completeness percentage) in responses so consumers understand what they’re getting. This approach balances transparency with control.

API Versioning Strategies: Use semantic versioning with both API version and methodology version as separate dimensions. Structure your endpoints like /api/v2/products/{id}/carbon?methodology=ghg-2021. This allows you to evolve the API interface independently from carbon calculation standards. When new methodologies emerge (like updated GHG Protocol versions), you add methodology options without breaking existing integrations. Maintain deprecated methodology support for at least 24 months to give partners migration time. Document methodology differences clearly in API specs.

Audit Trail Requirements: Every sustainability data access must be traceable for compliance. Implement comprehensive audit logging that captures: requesting system identity, timestamp, query parameters, returned data snapshot hash, and applicable calculation methodology. Store this in an immutable audit table within SAP PLM. Expose audit history through a dedicated endpoint so compliance teams can demonstrate data lineage. Include digital signatures in API responses for high-stakes regulatory reporting. Consider implementing webhook notifications when sustainability data is updated so downstream systems can refresh their caches and maintain audit continuity.

One critical lesson: sustainability metrics often depend on third-party supplier data with varying quality levels. Your API should include data quality indicators (supplier-provided vs. industry-average, measurement vs. estimate, certification status) so consumers can assess reliability. This transparency is increasingly important for regulatory compliance and builds trust with partners using your sustainability data for their own reporting.