# Convert cXML PunchOut Carts & Order Confirmations to JSON

**Use case:** 

Decode B2B eCommerce cXML PunchOutOrderMessage shopping carts (BuyerCookie, SKU, quantity, unit price, UNSPSC) and supplier ConfirmationRequest acknowledgments into clean JSON for Shopify Plus, Magento, and custom B2B portals.

## Input

```json
{
  "operation_mode": "parse_and_audit_cxml",
  "cxml_documents": [
    "<cXML payloadID=\"punch-20261125-77@shop.example\" timestamp=\"2026-11-25T10:00:00Z\"><Header><From><Credential domain=\"DUNS\"><Identity>081466849</Identity></Credential></From><To><Credential domain=\"NetworkID\"><Identity>AN01000998877</Identity></Credential></To></Header><Message><PunchOutOrderMessage><BuyerCookie>COOKIE-SESSION-7712</BuyerCookie><PunchOutOrderMessageHeader operationAllowed=\"create\"><Total><Money currency=\"EUR\">246.90</Money></Total></PunchOutOrderMessageHeader><ItemIn quantity=\"6\"><ItemID><SupplierPartID>DIN-RAIL-24V</SupplierPartID></ItemID><ItemDetail><UnitPrice><Money currency=\"EUR\">41.15</Money></UnitPrice><Description xml:lang=\"en\">24V Industrial DIN Rail Power Supply</Description><UnitOfMeasure>EA</UnitOfMeasure><Classification domain=\"UNSPSC\">39121004</Classification></ItemDetail></ItemIn></PunchOutOrderMessage></Message></cXML>"
  ],
  "invoice_json_payloads": [],
  "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 "Convert cXML PunchOut Carts & Order Confirmations to JSON". [Sign up or log in](https://console.apify.com/create-task-from-example/7wwig22v7ngYVjj2h) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert cXML PunchOut Carts & Order Confirmations to 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 "Convert cXML PunchOut Carts & Order Confirmations to 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 "Convert cXML PunchOut Carts & Order Confirmations to JSON" task via API](https://apify.com/bifrost-data/cxml-ariba-coupa-procurement-bridge.md).

## FAQ

### Does it validate that PunchOut ItemIn quantities times unit prices match the cart header total?

Yes. Even during PunchOut cart return, exact Decimal math checks prevent Ariba or Coupa buyer-side cart rejection errors.

### Is the Ariba/Coupa BuyerCookie session token extracted into JSON?

Yes. BuyerCookie, supplier part IDs, UNSPSC codes, UOMs, and currency codes are returned as top-level structured fields.

### Can I mask buyer contact emails and phone numbers for staging logs?

Yes. Enable mask_contact_pii=true to redact contact emails and phone numbers while keeping SharedSecrets permanently redacted.

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