# Generate SAP Ariba & Coupa cXML InvoiceDetail XML from JSON

**Use case:** 

Turn simple ERP, Shopify, QuickBooks, or spreadsheet JSON invoice objects into DTD-compliant cXML 1.2 InvoiceDetailRequest XML ready for SAP Ariba and Coupa submission—with automatic Subtotal, TaxDetail, Shipping, GrossAmount, NetAmount, and DueAmount calculation.

## Input

```json
{
  "operation_mode": "generate_cxml_invoice",
  "cxml_documents": [],
  "invoice_json_payloads": [
    {
      "invoice_id": "INV-2026-99201",
      "invoice_date": "2026-11-24T12:00:00Z",
      "purpose": "standard",
      "order_id": "PO-2026-88410",
      "order_payload_id": "1732440001.99812@ariba.acme.com",
      "from_identity": "081466849",
      "from_domain": "DUNS",
      "to_identity": "AN01000998877",
      "to_domain": "NetworkID",
      "currency": "USD",
      "tax_rate_percent": 8.25,
      "shipping_amount": "25.00",
      "payment_net_days": 30,
      "remit_to_name": "Precision Valve Supply LLC",
      "bill_to_name": "Acme Accounts Payable",
      "items": [
        {
          "invoice_line_number": 1,
          "order_line_number": 10,
          "supplier_part_id": "VLV-SS316-2IN",
          "description": "2-Inch 316 Stainless Ball Valve NPT",
          "quantity": "10",
          "uom": "EA",
          "unit_price": "125.00"
        }
      ]
    }
  ],
  "strict_math_audit": true,
  "mask_contact_pii": false,
  "max_items": 25
}
```

## Output

```json
{
  "document_type": {
    "label": "Doc Type",
    "format": "string"
  },
  "document_id": {
    "label": "Document / PO / Invoice ID",
    "format": "string"
  },
  "related_order_id": {
    "label": "Ref PO ID",
    "format": "string"
  },
  "from_identity": {
    "label": "From (ANID/DUNS)",
    "format": "string"
  },
  "to_identity": {
    "label": "To (ANID/DUNS)",
    "format": "string"
  },
  "currency": {
    "label": "CCY",
    "format": "string"
  },
  "subtotal_amount": {
    "label": "Subtotal",
    "format": "string"
  },
  "tax_amount": {
    "label": "Tax",
    "format": "string"
  },
  "total_or_due_amount": {
    "label": "Total / Due",
    "format": "string"
  },
  "line_count": {
    "label": "Lines",
    "format": "integer"
  },
  "is_valid": {
    "label": "Valid",
    "format": "boolean"
  },
  "math_reconciled": {
    "label": "Math OK",
    "format": "boolean"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The cXML SAP Ariba & Coupa Order, ASN & Invoice JSON Bridge Actor is ready to run with the inputs already set for "Generate SAP Ariba & Coupa cXML InvoiceDetail XML from JSON". [Sign up or log in](https://console.apify.com/create-task-from-example/togUod9nOyfz3Txv9) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Generate SAP Ariba & Coupa cXML InvoiceDetail XML from JSON" task

The cXML SAP Ariba & Coupa Order, ASN & Invoice JSON Bridge Actor will start running based on the input automatically. You can also change all the input fields, like operation mode, raw cxml xml documents, and more, to match your specific use case.

### 3. Receive the "Generate SAP Ariba & Coupa cXML InvoiceDetail XML from JSON" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as doc type, document / po / invoice id, ref po id, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Generate SAP Ariba & Coupa cXML InvoiceDetail XML from JSON" task via API](https://apify.com/bifrost-data/cxml-ariba-coupa-procurement-bridge.md).

## FAQ

### Can Shopify, NetSuite, or QuickBooks sellers generate Ariba/Coupa cXML invoices without middleware?

Yes. Pass a simple JSON object with order_id, items, tax_rate_percent, and shipping_amount to receive DTD-compliant cXML 1.2 InvoiceDetailRequest XML.

### Are SubtotalAmount, TaxDetail, GrossAmount, NetAmount, and DueAmount calculated automatically?

Yes. All mandatory cXML 1.2 InvoiceDetailSummary nodes are computed with exact 2-decimal rounding and self-audited before output.

### How much does cXML generation cost compared to enterprise EDI VANs?

Just $0.008 per verified document ($8.00 per 1,000, down to $6.40/1k on Gold plans) with zero monthly seat or VAN subscription fees.

## About this Actor

This example demonstrates how to use [cXML SAP Ariba & Coupa Order, ASN & Invoice JSON Bridge](https://apify.com/bifrost-data/cxml-ariba-coupa-procurement-bridge.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/bifrost-data/cxml-ariba-coupa-procurement-bridge.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/bifrost-data/cxml-ariba-coupa-procurement-bridge.md

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`).
