{
  "openapi": "3.0.1",
  "info": {
    "title": "UN/EDIFACT Transaction Quality Gate",
    "description": "Validate ORDERS, INVOIC, DESADV, and CONTRL syntax, envelopes, counts, narrow structure, and partner overlays with stable evidence and optional acknowledgements.",
    "version": "0.1",
    "x-build-id": "UF8a1WbnAZWimWVgT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ceddl~unedifact-transaction-quality-gate/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ceddl-unedifact-transaction-quality-gate",
        "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/ceddl~unedifact-transaction-quality-gate/runs": {
      "post": {
        "operationId": "runs-sync-ceddl-unedifact-transaction-quality-gate",
        "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/ceddl~unedifact-transaction-quality-gate/run-sync": {
      "post": {
        "operationId": "run-sync-ceddl-unedifact-transaction-quality-gate",
        "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",
        "required": [
          "interchanges",
          "directory"
        ],
        "properties": {
          "interchanges": {
            "title": "EDIFACT interchanges",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Inline bounded UN/EDIFACT interchanges processed independently.",
            "items": {
              "type": "object",
              "required": [
                "content"
              ],
              "additionalProperties": false,
              "properties": {
                "sourceId": {
                  "title": "Source ID",
                  "description": "Optional stable identifier used in output records.",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "content": {
                  "title": "Interchange content",
                  "description": "Inline UN/EDIFACT interchange text.",
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "directory": {
            "title": "Pinned compatibility target",
            "enum": [
              "D96A",
              "D01B",
              "D20B"
            ],
            "type": "string",
            "description": "UN/EDIFACT directory identifier used by the narrow original validation profile."
          },
          "mode": {
            "title": "Validation mode",
            "enum": [
              "strict",
              "tolerant"
            ],
            "type": "string",
            "description": "Strict fails profile errors; tolerant reports them while preserving evidence.",
            "default": "strict"
          },
          "generateContrl": {
            "title": "Generate CONTRL acknowledgements",
            "type": "boolean",
            "description": "Write deterministic CONTRL acknowledgement text for completed interchanges.",
            "default": false
          },
          "partnerRules": {
            "title": "Partner overlay rules",
            "maxItems": 100,
            "type": "array",
            "description": "Optional bounded required/forbidden segment rules for supported message types.",
            "items": {
              "type": "object",
              "required": [
                "id",
                "messageType"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "title": "Rule ID",
                  "description": "Stable identifier for the partner overlay.",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "messageType": {
                  "title": "Message type",
                  "description": "Supported message type to which the overlay applies.",
                  "type": "string",
                  "enum": [
                    "ORDERS",
                    "INVOIC",
                    "DESADV",
                    "CONTRL"
                  ]
                },
                "requiredSegments": {
                  "title": "Required segments",
                  "description": "Segment tags that must occur in the transaction.",
                  "type": "array",
                  "maxItems": 50,
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  }
                },
                "forbiddenSegments": {
                  "title": "Forbidden segments",
                  "description": "Segment tags that must not occur in the transaction.",
                  "type": "array",
                  "maxItems": 50,
                  "items": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  }
                }
              }
            }
          },
          "maxInterchangeBytes": {
            "title": "Maximum bytes per interchange",
            "minimum": 128,
            "maximum": 10000000,
            "type": "integer",
            "description": "Fail an interchange when its UTF-8 input exceeds this byte limit.",
            "default": 2000000
          },
          "maxSegmentsPerInterchange": {
            "title": "Maximum segments per interchange",
            "minimum": 4,
            "maximum": 100000,
            "type": "integer",
            "description": "Fail an interchange when its parsed segment count exceeds this limit.",
            "default": 20000
          },
          "maxMessagesPerInterchange": {
            "title": "Maximum messages per interchange",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Fail an interchange when its parsed message count exceeds this limit.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}