{
  "openapi": "3.0.1",
  "info": {
    "title": "French DGFiP FEC Tax-Audit & LME Validator",
    "description": "Validate French DGFiP FEC accounting files (LPF Art. A.47 A-1) & audit B2B LME payment terms (Art. L.441-10) by AGOS. Checks 18/21/22-col layouts, SIREN naming, dates, entry balance, PCG VAT/cash/suspense & DGCCRF exposure with rulesetVersion provenance.",
    "version": "1.0",
    "x-build-id": "L5jhHqyqJsvla2T86"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/agos~fr-fec-tax-audit-validator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-agos-fr-fec-tax-audit-validator",
        "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/agos~fr-fec-tax-audit-validator/runs": {
      "post": {
        "operationId": "runs-sync-agos-fr-fec-tax-audit-validator",
        "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/agos~fr-fec-tax-audit-validator/run-sync": {
      "post": {
        "operationId": "run-sync-agos-fr-fec-tax-audit-validator",
        "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": {
          "fecContent": {
            "title": "FEC File Content (Single-File Mode)",
            "type": "string",
            "description": "Raw French FEC file content (pipe '|' or tab delimited, including the 18-column general or 21/22-column BIC/BNC cash header row). Used when files[] is empty."
          },
          "fileName": {
            "title": "FEC Filename (Optional)",
            "type": "string",
            "description": "Optional DGFiP FEC filename (e.g. 552032534FEC20251231.txt) for SIREN Luhn + closing-date naming validation."
          },
          "regime": {
            "title": "Accounting Regime Layout",
            "enum": [
              "auto",
              "general",
              "bic_bnc_cash"
            ],
            "type": "string",
            "description": "FEC statutory column layout detection mode.",
            "default": "auto"
          },
          "fiscalYearStart": {
            "title": "Fiscal Year Start Date (Optional)",
            "type": "string",
            "description": "Optional fiscal year start date (YYYYMMDD or YYYY-MM-DD) to detect out-of-period postings."
          },
          "fiscalYearEnd": {
            "title": "Fiscal Year End Date (Optional)",
            "type": "string",
            "description": "Optional fiscal year end date (YYYYMMDD or YYYY-MM-DD) to detect out-of-period postings."
          },
          "includeTrialBalance": {
            "title": "Include PCG Trial Balance",
            "type": "boolean",
            "description": "Compute a Plan Comptable General (PCG) trial balance grouped by CompteNum.",
            "default": true
          },
          "includeLmeAudit": {
            "title": "Include LME B2B Payment-Terms Audit",
            "type": "boolean",
            "description": "Run Code de commerce Art. L.441-10 LME payment-delay audit on supplier (401) and customer (411) accounts (60d net / 45d EOM, EUR 40 recovery fees, DGCCRF exposure).",
            "default": true
          },
          "lmeTermMode": {
            "title": "LME Statutory Term Baseline",
            "enum": [
              "auto",
              "60d_net",
              "45d_eom"
            ],
            "type": "string",
            "description": "Statutory LME payment-term due-date baseline mode.",
            "default": "auto"
          },
          "maxRows": {
            "title": "Max Data Rows per File",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum FEC data rows to parse per file (1 to 50000).",
            "default": 50000
          },
          "ecbRefiRatePct": {
            "title": "ECB Main Refinancing Rate (%) (Optional)",
            "type": "number",
            "description": "Optional ECB main refinancing rate (%) used to compute statutory LME late-payment interest (ECB + 10 pts)."
          },
          "lmeAnnualInterestRatePct": {
            "title": "Explicit Annual LME Interest Rate (%) (Optional)",
            "type": "number",
            "description": "Optional explicit annual late-payment interest rate (%) overriding the ECB-derived default."
          },
          "files": {
            "title": "Batch FEC Files (Optional, Max 20)",
            "maxItems": 20,
            "type": "array",
            "description": "Optional array of up to 20 FEC file objects to validate in a single Actor run. Each item requires { fecContent, fileName?, id?, regime?, fiscalYearStart?, fiscalYearEnd?, includeTrialBalance?, includeLmeAudit?, maxRows?, ecbRefiRatePct?, lmeAnnualInterestRatePct?, lmeTermMode? }. When non-empty, files[] takes precedence over single-file mode."
          },
          "continueOnError": {
            "title": "Continue Batch on File Error",
            "type": "boolean",
            "description": "In batch mode, continue validating remaining files if one entry is malformed (malformed entries are not charged).",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}