{
  "openapi": "3.0.1",
  "info": {
    "title": "cXML SAP Ariba & Coupa Order, ASN & Invoice JSON Bridge",
    "description": "Convert SAP Ariba, Coupa, and Jaggaer cXML Purchase Orders, Ship Notices (ASN), and Invoices into clean JSON, CSV, or Excel — or generate compliant cXML Invoices for n8n, Make, NetSuite, and ERP agents. Audits 3-way line-item math, tax totals, and UNSPSC codes with zero retention.",
    "version": "1.0",
    "x-build-id": "MiuElcyt4HTxfmrwo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bifrost-data~cxml-ariba-coupa-procurement-bridge/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bifrost-data-cxml-ariba-coupa-procurement-bridge",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/bifrost-data~cxml-ariba-coupa-procurement-bridge/runs": {
      "post": {
        "operationId": "runs-sync-bifrost-data-cxml-ariba-coupa-procurement-bridge",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/bifrost-data~cxml-ariba-coupa-procurement-bridge/run-sync": {
      "post": {
        "operationId": "run-sync-bifrost-data-cxml-ariba-coupa-procurement-bridge",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "operation_mode": {
            "title": "Operation Mode",
            "enum": [
              "parse_and_audit_cxml",
              "generate_cxml_invoice",
              "both"
            ],
            "type": "string",
            "description": "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'.",
            "default": "parse_and_audit_cxml"
          },
          "cxml_documents": {
            "title": "Raw cXML XML Documents",
            "type": "array",
            "description": "Array of raw cXML 1.2 XML strings (OrderRequest, InvoiceDetailRequest, ShipNoticeRequest, ConfirmationRequest, or PunchOutOrderMessage). Benign <!DOCTYPE cXML ...> headers are handled offline.",
            "default": [
              "<!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>"
            ],
            "items": {
              "type": "string"
            }
          },
          "invoice_json_payloads": {
            "title": "JSON Payloads for cXML Invoice Generation (Optional)",
            "type": "array",
            "description": "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'.",
            "default": []
          },
          "strict_math_audit": {
            "title": "Audit Line-Item, Tax & Summary Totals (Decimal)",
            "type": "boolean",
            "description": "Verify exact Decimal consistency across ItemOut/InvoiceDetailItem quantities, unit prices, SubtotalAmount, Tax, Shipping, Discount, and Net/Due/Total amounts.",
            "default": true
          },
          "mask_contact_pii": {
            "title": "Mask Contact Emails & Phone Numbers",
            "type": "boolean",
            "description": "Mask contact emails and phone numbers inside ShipTo/BillTo/Contact blocks (Ariba SharedSecret credentials are always redacted automatically).",
            "default": false
          },
          "max_items": {
            "title": "Max Verified Documents to Process",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of verified cXML documents to emit and charge in this run.",
            "default": 100
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}