# cXML SAP Ariba & Coupa Order, ASN & Invoice JSON Bridge (`bifrost-data/cxml-ariba-coupa-procurement-bridge`) Actor

Stateless zero-retention B2B procurement engine. Parse, audit, and convert SAP Ariba, Coupa, and Jaggaer cXML OrderRequest, InvoiceDetailRequest, ShipNoticeRequest, ConfirmationRequest, and PunchOutOrderMessage XML into clean JSON with Decimal tax/total verification.

- **URL**: https://apify.com/bifrost-data/cxml-ariba-coupa-procurement-bridge.md
- **Developed by:** [SEOK HOON HONG](https://apify.com/bifrost-data) (community)
- **Categories:** Developer tools, Business, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.40 / 1,000 verified cxml procurement documents

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## cXML SAP Ariba & Coupa Order, ASN & Invoice JSON Bridge

Convert messy **SAP Ariba, Coupa, Jaggaer, and Oracle Procurement `cXML` Purchase Orders (`OrderRequest`), Invoices (`InvoiceDetailRequest`), Advance Ship Notices (`ShipNoticeRequest`), Order Confirmations (`ConfirmationRequest`), and PunchOut Carts (`PunchOutOrderMessage`)** directly into clean, ERP-ready JSON rows—or generate compliant `cXML 1.2 InvoiceDetailRequest` XML from simple JSON—in **256 MB zero-retention RAM** with zero middleware subscriptions.

Built for **B2B suppliers, wholesale ops teams, accountants, and Make / Zapier / n8n / Shopify / NetSuite / QuickBooks workflows** whose enterprise customers require SAP Ariba or Coupa `cXML` integration without paying $500+/month EDI VAN fees.

### What You Get in 5 Seconds

- **5-in-1 cXML Inbound Normalization**: Parses `OrderRequest` (PO), `InvoiceDetailRequest` (Standard Invoice, Credit Memo, Debit Memo, plus Ariba/TradeCentric `InvoiceRequest` variants), `ShipNoticeRequest` (ASN with SCAC carrier & tracking IDs), `ConfirmationRequest` (PO Ack), and `PunchOutOrderMessage` carts.
- **2-Way / Summary Exact `Decimal` Math Audit**: Reconciles `sum(quantity * unit_price)` against `SubtotalAmount` and verifies `Subtotal + Tax + Shipping + Handling - Discount == NetAmount / DueAmount` down to the cent, flagging duplicate `invoiceID` or missing `TaxDetail` traps before Ariba rejects your invoice.
- **Reverse JSON-to-cXML Invoice Builder (`generate_cxml_invoice`)**: Pass a clean JSON object from Excel, QuickBooks, NetSuite, or Shopify to generate DTD-structured `cXML 1.2.061 InvoiceDetailRequest` XML ready to POST to SAP Ariba or Coupa.
- **Offline DTD & Automatic Secret Protection**: Safely strips external `<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/...">` DTD headers offline while blocking malicious `<!ENTITY` XXE payloads (`$0.00` charge) and automatically redacting `<SharedSecret>` credentials (`[REDACTED-SECRET]`).

### Sample Output Record

```json
{
  "record_id": "9f12c480a71b4e22940f8c2a1d881102",
  "operation": "parsed_cxml",
  "document_type": "OrderRequest",
  "cxml_version": "1.2.061",
  "payload_id": "1732440001.99812@ariba.acme.com",
  "deployment_mode": "production",
  "document_id": "PO-2026-88410",
  "related_order_id": "PO-2026-88410",
  "document_date": "2026-11-24T09:00:00Z",
  "purpose_or_status": "new",
  "from_identity": "AN01000998877",
  "to_identity": "081466849",
  "sender_identity": "AN01000000001",
  "shared_secret_redacted": true,
  "currency": "USD",
  "subtotal_amount": "1250.00",
  "tax_amount": "0.00",
  "shipping_amount": "0.00",
  "handling_amount": "0.00",
  "discount_amount": "0.00",
  "total_or_due_amount": "1250.00",
  "calculated_lines_subtotal": "1250.00",
  "payment_net_days": 30,
  "line_count": 1,
  "is_valid": true,
  "math_reconciled": true,
  "validation_findings": []
}
```

### Transparent Pay-Per-Event Pricing

- **Actor Start**: `$0.00005`
- **Verified cXML Document (`verified-cxml-document`)**: `$0.008` per verified document (`$8.00` per 1,000 documents). Malformed XML and blocked XXE inputs cost `$0.00`.

### Related Finance & B2B Automation Tools by `bifrost-data`

| Actor | Use Case | Pricing |
| :--- | :--- | :--- |
| [ISO 20022 pain.001, pacs.008 & camt.053 JSON Bridge](https://apify.com/bifrost-data/iso20022-payment-statement-bridge) | Audit SEPA/Swiss SPS 2026 structured addresses, IBAN Mod-97, and convert MT940 to camt.053 | `$8.00 / 1k` |
| [BAI2 & OFX/QFX Bank Statement to JSON & camt.053 Bridge](https://apify.com/bifrost-data/bai2-ofx-bank-statement-bridge) | Reconcile US corporate BAI2 lockbox files (01-99) and OFX/QFX card/bank statements | `$8.00 / 1k` |
| [SWIFT MT103 & MT202 to ISO 20022 CBPR+ pacs.008 Bridge](https://apify.com/bifrost-data/swift-mt103-cbpr-pacs008-wire-bridge) | Parse cross-border MT103 wire proofs, detect fake MT103 red flags, and map to pacs.008 XML | `$8.00 / 1k` |
| [Palo Alto PAN-OS, Prisma & Cortex CVE Advisory Scraper](https://apify.com/bifrost-data/paloalto-panos-security-advisories-scraper) | Track official PAN-OS CVSS v4/v3 scores, fixed hotfix trains, and Threat Prevention IDs | `$2.20 / 1k` |

# Actor input Schema

## `operation_mode` (type: `string`):

Choose 'parse_and_audit_cxml' to parse incoming cXML XML documents (PO, Invoice, ASN, Confirmation, PunchOut), 'generate_cxml_invoice' to build compliant cXML InvoiceDetailRequest XML from JSON, or 'both'.

## `cxml_documents` (type: `array`):

Array of raw cXML 1.2 XML strings (OrderRequest, InvoiceDetailRequest, ShipNoticeRequest, ConfirmationRequest, or PunchOutOrderMessage). Benign <!DOCTYPE cXML ...> headers are handled offline.

## `invoice_json_payloads` (type: `array`):

Array of JSON invoice objects to convert into DTD-compliant SAP Ariba / Coupa cXML InvoiceDetailRequest XML when operation_mode is 'generate_cxml_invoice' or 'both'.

## `strict_math_audit` (type: `boolean`):

Verify exact Decimal consistency across ItemOut/InvoiceDetailItem quantities, unit prices, SubtotalAmount, Tax, Shipping, Discount, and Net/Due/Total amounts.

## `mask_contact_pii` (type: `boolean`):

Mask contact emails and phone numbers inside ShipTo/BillTo/Contact blocks (Ariba SharedSecret credentials are always redacted automatically).

## `max_items` (type: `integer`):

Maximum number of verified cXML documents to emit and charge in this run.

## Actor input object example

```json
{
  "operation_mode": "parse_and_audit_cxml",
  "cxml_documents": [
    "<!DOCTYPE cXML SYSTEM \"http://xml.cxml.org/schemas/cXML/1.2.061/cXML.dtd\">\n<cXML payloadID=\"1732440001.99812@ariba.acme.com\" timestamp=\"2026-11-24T09:15:00Z\" xml:lang=\"en-US\">\n  <Header>\n    <From><Credential domain=\"NetworkID\"><Identity>AN01000998877</Identity></Credential></From>\n    <To><Credential domain=\"DUNS\"><Identity>081466849</Identity></Credential></To>\n    <Sender><Credential domain=\"NetworkID\"><Identity>AN01000000001</Identity><SharedSecret>SUPER_SECRET_TOKEN_99</SharedSecret></Credential><UserAgent>Ariba SN 1.2</UserAgent></Sender>\n  </Header>\n  <Request deploymentMode=\"production\">\n    <OrderRequest>\n      <OrderRequestHeader orderID=\"PO-2026-88410\" orderDate=\"2026-11-24T09:00:00Z\" type=\"new\">\n        <Total><Money currency=\"USD\">1250.00</Money></Total>\n        <ShipTo><Address addressID=\"PLANT-01\"><Name xml:lang=\"en\">Acme Manufacturing Austin</Name><PostalAddress><DeliverTo>Receiving Dock B</DeliverTo><Street>400 Industrial Pkwy</Street><City>Austin</City><State>TX</State><PostalCode>78701</PostalCode><Country isoCountryCode=\"US\">United States</Country></PostalAddress></Address></ShipTo>\n        <BillTo><Address addressID=\"AP-HQ\"><Name xml:lang=\"en\">Acme Accounts Payable</Name><PostalAddress><Street>100 Congress Ave</Street><City>Austin</City><State>TX</State><PostalCode>78701</PostalCode><Country isoCountryCode=\"US\">United States</Country></PostalAddress></Address></BillTo>\n        <PaymentTerm payInNumberOfDays=\"30\"/>\n        <Extrinsic name=\"Department\">MRO-OPERATIONS</Extrinsic>\n      </OrderRequestHeader>\n      <ItemOut quantity=\"10\" lineNumber=\"10\" requestedDeliveryDate=\"2026-12-02\">\n        <ItemID><SupplierPartID>VLV-SS316-2IN</SupplierPartID><BuyerPartID>ACM-009812</BuyerPartID></ItemID>\n        <ItemDetail>\n          <UnitPrice><Money currency=\"USD\">125.00</Money></UnitPrice>\n          <Description xml:lang=\"en\">2-Inch 316 Stainless Ball Valve NPT</Description>\n          <UnitOfMeasure>EA</UnitOfMeasure>\n          <Classification domain=\"UNSPSC\">40141607</Classification>\n        </ItemDetail>\n      </ItemOut>\n    </OrderRequest>\n  </Request>\n</cXML>"
  ],
  "invoice_json_payloads": [],
  "strict_math_audit": true,
  "mask_contact_pii": false,
  "max_items": 100
}
```

# Actor output Schema

## `documents` (type: `string`):

Schema-verified SAP Ariba and Coupa cXML procurement documents with exact Decimal math reconciliation and optional generated cXML Invoice XML.

## `runMetrics` (type: `string`):

Execution telemetry including parsed documents, $0 invalid skips, and PPE billing counts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bifrost-data/cxml-ariba-coupa-procurement-bridge").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("bifrost-data/cxml-ariba-coupa-procurement-bridge").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call bifrost-data/cxml-ariba-coupa-procurement-bridge --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bifrost-data/cxml-ariba-coupa-procurement-bridge"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hTVfOUjyzz80SWmrV/builds/MiuElcyt4HTxfmrwo/openapi.json
