All blog articles
Integrating Nordoon with SAP BTP  for end-to-end PO automation

Integrating Nordoon with SAP BTP for end-to-end PO automation

This articles explains how Nordoon integrates natively with SAP Business Technology Platform (BTP) Integration Suite to automate purchase order confirmation processing.

Jan Rupnik
November 20, 2025
TIME TO READ:
MINUTES

This articles explains how Nordoon integrates natively with SAP Business Technology Platform (BTP) Integration Suite to automate purchase order confirmation processing.

Nordoon, the agentic AI platform for supply chain automation, equips organizations with AI Agents that transform back-office operations by replicating, expanding, and consolidating day-to-day processes while structuring and cleaning data at each stage. SAP BTP Integration Suite ensures these workflows are connected, governed, and extensible across the SAP landscape.

The power of native integration

Nordoon’s agentic platform does more than processing documents. It participates intelligently in enterprise workflows, validated by SAP data, and integrated with business processes. Together with SAP BTP Integration Suite, Nordoon's AI Agents provide companies with a scalable path to intelligent PO automation with full visibility and control.

Here are the 6 aspects of the integration that we are going to further explain in order to illustrate a production-ready, working integration (not a theoretical architecture).

1.       Complete BPMN flow canvas: Full integration flow showing all steps and system connections.

2.       Message processing log: Real execution showing 15.7-second processing time and processed PO data.

3.       Groovy script editor: Implementation of Nordoon's API request construction.

4.       Nordoon Agent data flow: Configuration of the PO Processing AI Agent.

5.       Nordoon REST API connector: Secure API key management and multi-tenant setup.

6.       SAP API Business Hub: Purchase Order OData service used for validation.

For a more hands-on understanding of what this integration entails you can watch the video, or you can go through each aspect detailed below.


Integration flow components

The integration flow (POAgent) orchestrates a multi-step process that spans three systems:

Key technical participants:

1.      Sender (HTTPS): External system sending PDF documents

2.      Nordoon_AI: AI Agent platform processing documents

3.      SAP_S4HANA: Enterprise system for validation and data persistence


Process flow sequence

Figure 0: Complete BPMN 2.0 integration flow canvas in SAP Integration Suite showing the “PO Agent Flow” end-to-end.

The flow orchestrates the communication between three systems (Sender, Nordoon_AI, SAP_S4HANA) through a series of transformation steps, API calls, and validation logic. Each box represents a processing step (Content Enricher, Groovy Script, or HTTP Service Task), connected by sequence flows. This visual representation demonstrates the enterprise-grade orchestration capabilities of SAP BTP.

Key components visible in Figure 0:

  • Start Event (HTTPS): Receives incoming PDF documents
  • Content Enrichers (blue boxes): Set headers and properties
  • Groovy Scripts (gear icons): Data transformation and validation logic
  • Service Tasks (external call icons): HTTP calls to Nordoon and SAP APIs
  • Message Flows (dashed lines): Show communication with external systems
  • Sequence Flows (solid lines): Processing order within integration flow

Technical implementation details

1. Integration flow definition

Technology stack:

  • Standard: BPMN 2.0 (Business Process Model and Notation)
  • Runtime: SAP Cloud Integration (BTP Integration Suite)
  • Scripting:Groovy (Apache Groovy 2.4+)
  • Protocol: HTTP/HTTPS with OAuth/API Key authentication

Integration flow file: PO Agent.iflw

  • Component version: 1.2
  • Transaction handling: Not Required (stateless)
  • Transaction timeout: 30 seconds
  • Logging: All events captured

2. Entry point: HTTPS sender adapter

Endpoint configuration:

URL Path:/po-confirmation/extract
Protocol: HTTPS (TLS 1.2+)
Authentication: Role-Based (ESBMessaging.send)
Max Body Size: 40 MB
XSRF Protection: Disabled (API endpoint)

Security model:

  • Role-based authorization ensures only authenticated callers can trigger the flow
  • Supports client certificate authentication
  • No basic authentication (enterprise SSO integration)

3. Nordoon AI integration layer

Step 3a: Prepare Nordoon request


Content Enricher Pattern
(CallActivity_5):

  • Creates exchange properties for API credentials
  • Stores: nordoon.api.key, nordoon.endpoint.uuid, sap.api.key
  • Credentials sourced from secure SAP credential store (production best practice)

Step 3b: Build request payload

Script:
build_nordoon_request.groovy

Figure1: Groovy script editor in SAP Integration Suite showing the build_nordoon_request.groovy implementation.

The editor provides syntax highlighting, code folding, and integrated validation. Note the structured JSON construction and debug logging for security (only first 10 characters of API key logged).

def nordoonRequest = [
    name: 'PO Confirmation ' + new Date().format('yyyy-MM-dd HH:mm:ss'),
    input_file: [
        filename: 'confirmation.pdf',
        mimetype: 'application/pdf',
        base64: pdfContent  // Base64-encoded PDF from sender
    ]
]


Key technical aspects:

  • Accepts PDF as base64-encoded string in HTTP body
  • Constructs JSON payload conforming to Nordoon API v2.0 spec
  • Sets Content-Type: application/json header
  • Injects API key via x-api-key header
  • Generates unique job name with timestamp for traceability
  • Includes debug logging attachment for troubleshooting (visible in Message Processing Logs)


Step 3c: Call Nordoon API

Nordoon Agent configuration

Figure2: Nordoon platform showing the “SAP BTP Order Confirmations Flow”configuration.

The agent data flow consists of a RESTAPI trigger, business logic agent, and REST API output formatter.

The endpoint UUID (320da0f68c324e019547d2e8a8118cc2) uniquely identifies this agent configuration.

Figure3: REST API connector configuration in Nordoon showing tenant ID, region (EU),and API key management.

This connector is used by the “SAP BTP Order Confirmations Flow” as an Agent Data Flow, demonstrating how Nordoon Agents can be reused across multiple automation workflows.

HTTP adapter configuration:


Endpoint: https://app-eu.nordoon.ai/api/v2.0/public/extract/${property.nordoon.endpoint.uuid}/sync/
Method: POST
Timeout: 60000ms (60 seconds)
Retry: 1 iteration, 5-second interval
Authentication: API Key (x-api-key header)
Region: EU (app-eu.nordoon.ai)


Synchronous processing:

  • Uses /sync/ endpoint for real-time response
  • Nordoon processes document and returns structured JSON
  • No polling required, the AI agent completes processing within timeout window

Response structure:

{
  "result": [{
    "General Info": {
      "Purchase Order Number": "4500000001"
    },
    "Items": [
      {
        "Item Number": "10",
        "Material Description": "VAI101 - Widget Type A",
        "Confirmed Quantity": "100",
        "Confirmed Delivery Date": "2025-11-20"
      }
    ]
  }]
}


Step 3d: Parse Nordoon Response

Script: parse_nordoon_response.groovy

def nordoonResult = jsonSlurper.parseText(responseBody)

// Extract structured data from AI agent response
def poNumber = nordoonResult.result[0]?.'General Info'?.'Purchase Order Number'
def items = nordoonResult.result[0]?.Items

// Store in message exchange properties
message.setProperty('po.number', poNumber)
message.setProperty('po.items.count', items?.size()?.toString() ?: '0')
message.setProperty('nordoon.result', responseBody)  // Full result for transformation

// Set PO number as body for next step (SAP validation)
message.setBody(poNumber)


Data processing:

  • Safe navigation operators (?.) handle missing fields gracefully
  • Stores full AI response for downstream processing
  • Extracts PO number and item count as discrete properties
  • Prepares body for SAP OData GET request

4. SAPS/4HANA integration layer

Step 4a: Validate that PO exists in SAP

Purpose:
Verify that the PO number processed by Nordoon actually exists in SAP before posting confirmations.

Figure4: SAP API Business Hub showing the Purchase Order Process Service API (API_PURCHASEORDER_PROCESS_SRV). The “Try Out” functionality in the Sandbox environment allows testing the GET /A_PurchaseOrder(‘{PurchaseOrder}’)endpoint.

This same OData service is used in the integration flow to validate PO numbers extracted by Nordoon.


HTTP GET request:

Endpoint: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder('${in.body}')
Method: GET
Headers:
  - Accept: application/json
  - apikey: ${property.sap.api.key}


Real-world example:

  • Nordoon extracts PO Number: 4500003529
  • SAP Integration Suite constructs OData URL: /A_PurchaseOrder('4500003529')
  • SAP validates existence and returns PO master data
  • Flow proceeds only if validation succeeds (HTTP 200)


Dynamic URL construction:

  • ${in.body} contains PO number from Nordoon parsing step
  • OData V2 entity retrieval by key
  • Example: /A_PurchaseOrder('4500000001')

Validation script: check_call_got_200.groovy

Endpoint: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder('${in.body}')
Method: GET
Headers:
  - Accept: application/json
  - apikey: ${property.sap.api.key}


Error handling:

  • 200: PO exists, proceed to transformation
  • 404: PO not found in SAP (data mismatch)
  • 401: Authentication failure
  • Other: Network/API errors

Step 4b: Tranform to SAP OData format

Script: transform_to_sap_format.groovy

if (item.'Confirmed Quantity') {
        sapConfirmations.add([
            PurchaseOrder: poNumber,
            PurchaseOrderItem: item.'Item Number',
            ConfirmedQuantity: (item.'Confirmed Quantity' as Integer),
            ScheduleLineDeliveryDate: item.'Confirmed Delivery Date' ?: null,
            Material: extractMaterialNumber(item.'Material Description'),
            Plant: "1000"
        ])
    }
}


Data mapping:

Material number:

def extractMaterialNumber(String description) {
    def parts = description.split(' - ')
    return parts.length > 0 ? parts[0].trim() : description
}


Output payload:

{
  "confirmations": [
    {
      "PurchaseOrder": "4500000001",
      "PurchaseOrderItem": "10",
      "ConfirmedQuantity": 100,
      "ScheduleLineDeliveryDate": "2025-11-20",
      "Material": "VAI101",
      "Plant": "1000"
    }
  ]
}


Step 4c: Post Confirmations to SAP

HTTP POST request:

Endpoint: https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrderScheduleLine
Method: POST
Headers:
  - Accept: application/json
  - Content-Type: application/json
  - apikey: ${property.sap.api.key}


Production considerations:

  • For multiple items, use OData $batch endpoint for atomic operations
  • Transaction handling ensures all-or-nothing posting
  • SAP will trigger workflow events (PO confirmation posted)

Step 4d: Response validation

Script: post_to_sap_check.groovy

if (responseCode >= 200 && responseCode < 300) {
    // Success
    String successResponse = """
    {
        "status":"success",
        "message":"PO confirmation posted to SAP successfully",
        "po_number":"${poNumber}",
        "items_confirmed":${itemsCount},
        "sap_response_code":${responseCode}
    }
    """
    message.setBody(successResponse)

} else if (responseCode == 405) {
    // Sandbox limitation - treat as success
    String successResponse = """
    {
        "status":"success_simulated",
        "message":"PO validated successfully. Posting simulated (sandbox limitation)",
        "note":"SAP sandbox does not allow POST operations..."
    }
    """
    message.setBody(successResponse)
}


Response codes:

  • 2xx: Successful posting, return confirmation JSON
  • 400: Bad request, data validation failed
  • 401: Authentication error
  • 405: Method not allowed (sandbox limitation, production returns 201)

Monitoring and observability

SAP Integration Suite monitoring

Figure5: Message Processing Log (MPL) for a successful PO Agent Flow execution

Key information visible: Status(Completed), Processing Time (15.7 seconds), Log Level (Info), and custom attachments. The “Extracted_PO_Info” attachment shows PO Number: 4500003529 with 4 items processed. This demonstrates the enterprise-grade monitoring and transparency that SAP BTP provides for all integration flows.


Message processing logs:

  • Each integration flow execution creates a Message Processing Log(MPL)
  • Status: Completed, Failed, Retry
  • Execution time tracking (example:15.7 seconds for 4-item PO)
  • Full message payload at each step (when logging enabled)
  • Custom attachments for business-relevant data

Attachments for debugging:

if (messageLog != null) {
    messageLog.addAttachmentAsString(
        "Extracted_PO_Info",
        "PO Number: ${poNumber}\nItems Count: ${items?.size()}",
        "text/plain"
    )
}


Real-world monitoring data
(from Figure 5):

  • PO Number: 4500003529 successfully processed
  • 4 line items extracted from PDF and validated
  • Total processing time: 15.7seconds (including Nordoon AI processing, SAP validation, and data transformation)
  • Last updated: Nov 16, 2025, 23:47:24 - All debug attachments available: Debug_API_Key, Extracted_PO_Info, SAP_Payload_All_Items


Key metrics available:

  • Total messages processed
  • Success/failure rates
  • Average processing time
  • Error distribution by step
  • API response times (Nordoon vs SAP)
  • Custom business metrics (PO numbers processed, line items confirmed)

Error handling strategy

Exception propagation:

if (statusCode != 200) {
    throw new Exception("HTTP call failed. Expected 200, but got: ${statusCode}")
}

Flow-level error handling:

  • returnExceptionToSender: false
  • errors logged but not returned to caller
  • throwExceptionOnFailure:true
  • HTTP adapter fails on non-2xx responses
  • Transaction timeout: 30 seconds prevents hanging

Retry configuration:

  • HTTP calls: 1 retry after 5 seconds
  • Suitable for transient network errors
  • Production: configure exponential backoff

Enterprise extensions

1. SAP event mesh integration

Scenario: Trigger downstream processes when PO confirmations are posted.

<eventPublisher name="PO_Confirmation_Published">
    <topic>nordoon/po/confirmed</topic>
    <eventPayload>
        {
            "po_number": "${property.po.number}",
            "items_confirmed": "${property.po.items.count}",
            "source": "nordoon_integration"
        }
    </eventPayload>
</eventPublisher>

Use cases:

  • Notify procurement team of confirmations
  • Trigger inventoryplanning updates
  • Update external logistics systems

2. SAP business workflow for approvals

Extension point: After Nordoon parsing, before SAP posting

// Check if confirmation requires approval
if (totalValue > approvalThreshold) {
    message.setProperty('approval.required', 'true')
    message.setProperty('approval.workflow.id', 'WS99000001')
}

Workflow integration:

  • Route to SAP Workflow Service (BTP)
  • Approvers review Nordoon-processed data
  • Approval triggers continuation of integration flow -Rejection logs reason and halts process

3. Multi-system orchestration

Example: Integrate with external logistics provider

Nordoon Processing → SAPValidation → Logistics API → SAP Confirmation


Additional steps:

1. After PO validation, call logistics provider API to check delivery capacity

2. If capacity available, reserve slot and get confirmation number

3. Include logistics confirmation number in SAP posting

4. All orchestrated in single integration flow

4. Advanced error handling

Dead letter queue pattern:

// In exception subprocess
message.setProperty('error.timestamp', new Date().toString())
message.setProperty('error.step', 'nordoon_api_call')
message.setProperty('error.original.payload', originalPayload)

// Route to error queue for manual review

Alerting integration:

  • Send to SAP Alert Notification service
  • Email/SMS to integration support team
  • Create incident in ServiceNow/SAP Solution Manager

Performance characteristics

Typical processing times

Scalability

Concurrent processing:

  • SAP BTP autoscales based on load
  • Nordoon API handles parallel requests
  • No message queuing required for moderate volumes

High-volume scenarios:

  • Batch processing: Collect PDFs, process in bulk
  • Asynchronous pattern: Use Nordoon async endpoints with polling
  • Message queue: JMS/AMQP for buffering during peak loads

Key takeaways for technical stakeholders

For SAP architects

  • Nordoon agents deploy as standard BPMN integration flows
  • No custom middleware or ETL tools required
  • Leverages existing SAP BTP security, monitoring, and governance

For AI/ML engineers

  • Agentic AI integrates into enterprise orchestration (not just API calls)
  • Synchronous processing (2-8 seconds) suitable for user-facing workflows
  • Multi-tenant SaaS with regional data residency (EU/US)

For business process owners

  • 95% time reduction (manual entry → automated processing)
  • Complete audit trail (every step logged in SAP)
  • Extensible to approvals, events, multi-step workflows

For CTOs

  • No vendor lock-in: Standard SAP BTP patterns
  • Cloud-native: Auto-scaling, multi-region, API-first
  • ROI: $50-100K annual savings for mid-size deployment

Appendix: Technical specifications

API Endpoints

Nordoon AI Platform:

BaseURL: https://app-eu.nordoon.ai
Endpoint:/api/v2.0/public/extract/{endpoint_uuid}/sync/
Method: POST
Authentication: x-api-key header
Response Time: 2-8 seconds (synchronous)
Max File Size: 40 MB

SAP S/4HANA OData(Sandbox):

BaseURL: https://sandbox.api.sap.com/s4hanacloud
PO Process API:/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV
Entities: A_PurchaseOrder,A_PurchaseOrderScheduleLine
Authentication: API Key (Production: OAuth 2.0)

Dependencies

SAP BTP integration suite:

  • Cloud Integration runtime 6.x+
  • GroovyScript Engine 1.1+
  • HTTP/HTTPS Adapters 1.17+


External services:

  • Nordoon AI Platform (v2.0 API)
  • SAP S/4HANA Cloud (2022 or later)
  • SAP API Business Hub (sandbox testing)


This integration was developed to demonstrate production-ready, enterprise-scale integration between Nordoon’s agentic AI platform and SAP BTP. All code and configurations shown are from a working integration flow deployed to SAP Integration Suite. For questions about implementing similar integrations, get in touch with us.

ABOUT THE AUTHOR
Jan Rupnik

Enjoyed this read?

Subscribe to our newsletter, and we will send AI automation insights like this straight to your inbox on a regular basis.