{
  "openapi": "3.0.1",
  "info": {
    "title": "Math-Verified Invoice & Bank PDF to QuickBooks/Xero JSON",
    "description": "Convert invoices, receipts, and bank statement PDFs into mathematically verified JSON + ready-to-import QuickBooks Online & Xero payloads. Dual-engine Gemini 2.5 Flash + deterministic pdfplumber parser with exact Python Decimal cross-footing & running-balance auditing.",
    "version": "1.0",
    "x-build-id": "mvmvzbbAqRdIyLRM0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zenonnnnnn~math-verified-invoice-json/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zenonnnnnn-math-verified-invoice-json",
        "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/zenonnnnnn~math-verified-invoice-json/runs": {
      "post": {
        "operationId": "runs-sync-zenonnnnnn-math-verified-invoice-json",
        "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/zenonnnnnn~math-verified-invoice-json/run-sync": {
      "post": {
        "operationId": "run-sync-zenonnnnnn-math-verified-invoice-json",
        "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": {
          "documentUrls": {
            "title": "Document URLs (PDF / PNG / JPG / WEBP)",
            "type": "array",
            "description": "Publicly accessible HTTPS/HTTP URLs pointing to invoice, receipt, or bank statement PDFs or images.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "documentsBase64": {
            "title": "Base64-Encoded Documents",
            "type": "array",
            "description": "Array of Base64-encoded document strings (or objects with {\"filename\", \"contentBase64\", \"mimeType\", \"documentType\"}). Ideal for n8n, Make, and Zapier webhook pipelines.",
            "default": []
          },
          "rawDocumentsText": {
            "title": "Raw Invoice / Statement Text Blocks",
            "type": "array",
            "description": "Optional array of raw OCR or email invoice/statement text strings (or objects with {\"filename\", \"rawText\", \"documentType\"}). Leave empty to run the built-in sample commercial invoice demo.",
            "default": []
          },
          "documentType": {
            "title": "Document Type",
            "enum": [
              "auto",
              "invoice",
              "bank_statement"
            ],
            "type": "string",
            "description": "Specify whether inputs are commercial invoices/receipts, bank statements, or auto-detected per document.",
            "default": "auto"
          },
          "extractionMode": {
            "title": "Extraction Engine Mode",
            "enum": [
              "auto",
              "gemini_only",
              "deterministic_only"
            ],
            "type": "string",
            "description": "Auto uses Gemini 2.5 Flash multimodal extraction when an API key is available (built-in or BYOK) and seamlessly falls back to the deterministic pdfplumber layout/table engine for native digital PDFs.",
            "default": "auto"
          },
          "geminiApiKey": {
            "title": "Custom Gemini API Key (Optional BYOK)",
            "type": "string",
            "description": "Optional: Provide your own Google Gemini API key (Bring Your Own Key). Leave blank to use the Actor's built-in multimodal service or deterministic PDF parser."
          },
          "geminiModel": {
            "title": "Gemini Model",
            "type": "string",
            "description": "Google Gemini multimodal model used when Engine A is active.",
            "default": "gemini-2.5-flash"
          },
          "mathTolerance": {
            "title": "Accounting Rounding Tolerance",
            "type": "string",
            "description": "Maximum allowed rounding variance (as a Decimal string, e.g. '0.02' for 2 cents) when auditing row cross-footing, column footing, and bank running balances.",
            "default": "0.02"
          },
          "defaultAccountCode": {
            "title": "Default GL Account Code (QuickBooks / Xero)",
            "type": "string",
            "description": "Default General Ledger expense account code mapped onto exported QuickBooks Online Bill and Xero ACCPAY line items.",
            "default": "400"
          },
          "defaultCurrency": {
            "title": "Fallback Currency (ISO 4217)",
            "type": "string",
            "description": "Fallback 3-letter ISO currency code when a document omits explicit currency symbols.",
            "default": "USD"
          },
          "maxPagesPerRun": {
            "title": "Max Pages Per Run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap on total audited document pages in a single Actor run (non-paying free-tier cloud runs are automatically capped at 5 pages).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}