{
  "openapi": "3.0.1",
  "info": {
    "title": "Conversor Extrato PDF para OFX, DANFE PDF e SEFAZ Brasil",
    "description": "Converte extratos bancários brasileiros em PDF para OFX e CSV/Excel com IA, transforma XML de NF-e em DANFE PDF oficial e consulta SEFAZ Nacional (DF-e) via Certificado A1.",
    "version": "1.0",
    "x-build-id": "fJtu84QJBahe95ZMz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/servico.1dex~conversor-pdf-ofx-danfe-sefaz/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-servico.1dex-conversor-pdf-ofx-danfe-sefaz",
        "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/servico.1dex~conversor-pdf-ofx-danfe-sefaz/runs": {
      "post": {
        "operationId": "runs-sync-servico.1dex-conversor-pdf-ofx-danfe-sefaz",
        "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/servico.1dex~conversor-pdf-ofx-danfe-sefaz/run-sync": {
      "post": {
        "operationId": "run-sync-servico.1dex-conversor-pdf-ofx-danfe-sefaz",
        "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": [
          "operation"
        ],
        "properties": {
          "apiKey": {
            "title": "🔑 1DEX API Key (Opcional para preview de extrato até 15 linhas)",
            "type": "string",
            "description": "Obtenha sua chave 1dex_usr_... gratuita (com 10 créditos de bônus imediato) em https://contabil.1dex.com.br/desenvolvedores"
          },
          "operation": {
            "title": "⚡ Operação Desejada",
            "enum": [
              "extrato_ofx",
              "danfe_pdf",
              "nf_xml_to_json",
              "nf_ocr",
              "sefaz_distribuicao",
              "sefaz_consultar_chave",
              "sefaz_manifestar",
              "fgts_analisar_pdf",
              "redesim_consultar",
              "fiscal_validar_chave"
            ],
            "type": "string",
            "description": "Selecione qual das 10 ferramentas da suíte 1DEX SisContábil deseja executar",
            "default": "extrato_ofx"
          },
          "texto": {
            "title": "📝 Texto do Extrato ou Nota Fiscal (Para operações 1 e 4)",
            "type": "string",
            "description": "Cole linhas do extrato bancário (operação 1) ou texto extraído da Nota Fiscal (operação 4) se não estiver enviando pdfBase64.",
            "default": "05/11/2026 PIX RECEBIDO CLIENTE LTDA 1.450,00 C\n06/11/2026 PAGTO BOLETO ENERGIA -280,50 D"
          },
          "pdfBase64": {
            "title": "📄 Arquivo PDF em Base64 (Para operações 1, 4 e 8)",
            "type": "string",
            "description": "Conteúdo Base64 do arquivo PDF (Extrato Bancário na op. 1, Nota Fiscal na op. 4, ou Extrato Analítico FGTS na op. 8)."
          },
          "bancoCodigo": {
            "title": "🏦 Código FEBRABAN do Banco (Para operação 1 - Extrato OFX)",
            "type": "string",
            "description": "Ex: 0341 (Itaú), 0237 (Bradesco), 0001 (Banco do Brasil), 0033 (Santander), 0104 (Caixa), 0260 (Nubank), 0077 (Inter), 0403 (Cora).",
            "default": "0341"
          },
          "xml": {
            "title": "🧾 XML da NF-e / NFC-e (Para operações 2 - DANFE PDF e 3 - XML para JSON)",
            "type": "string",
            "description": "Cole o conteúdo completo do arquivo XML da Nota Fiscal Eletrônica (<nfeProc> ou <NFe>). Na operação 2, retorna o PDF oficial do DANFE em Base64; na operação 3, retorna o JSON estruturado com auditoria de impostos."
          },
          "pfxBase64": {
            "title": "🔐 Certificado Digital A1 (.pfx) em Base64 (Para operações 5, 6 e 7 - SEFAZ)",
            "type": "string",
            "description": "Seu arquivo de certificado ICP-Brasil A1 (.pfx ou .p12) convertido para texto Base64. Exemplo no Linux: base64 -w 0 certificado.pfx"
          },
          "senha": {
            "title": "🔑 Senha do Certificado A1 (Para operações 5, 6 e 7 - SEFAZ)",
            "type": "string",
            "description": "Senha do arquivo .pfx para autenticação mTLS e assinatura digital na SEFAZ Nacional (processado 100% em memória, zero retenção)."
          },
          "cnpj": {
            "title": "🏢 CNPJ ou CPF Titular do Certificado (Para operações 5, 6 e 7 - SEFAZ)",
            "type": "string",
            "description": "Apenas os 14 números do CNPJ (ou 11 números do CPF) da empresa titular do Certificado A1."
          },
          "ultNSU": {
            "title": "🔢 Último NSU Sincronizado (Para operação 5 - sefaz_distribuicao)",
            "type": "string",
            "description": "Envie '0' na primeira consulta para buscar desde o início, ou envie o ultNSU retornado na consulta anterior para buscar apenas novos lotes de notas.",
            "default": "0"
          },
          "chave": {
            "title": "🔍 Chave de Acesso de 44 Dígitos (Para operações 6, 7 e 10)",
            "type": "string",
            "description": "Os 44 dígitos numéricos da Chave de Acesso da NF-e, NFC-e ou CT-e."
          },
          "protocolo": {
            "title": "📋 Protocolo REDESIM / Jucerja (Para operação 9)",
            "type": "string",
            "description": "Número do protocolo societário para consulta de andamento e exigências (ex: RJN2600012345)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}