# ============================================ # CURL PARA IMPORTAR FATURA VIA API # ============================================ # EXEMPLO BÁSICO (1 item) curl -X POST "https://seu-dominio.com/api/invoices" \ -H "Authorization: Basic $(echo -n 'SEU_TOKEN_AQUI:' | base64)" \ -H "Content-Type: application/json" \ -d '{ "clientid": 1, "number": "FAT-2025-001", "date": "2025-11-04", "currency": 1, "subtotal": 800.00, "total": 800.00, "billing_street": "Rua Exemplo, 123", "billing_city": "Recife", "billing_state": "PE", "allowed_payment_modes": [1], "newitems": [ { "description": "Consulta Médica", "long_description": "Tipo: Consulta | Executor: Dr. João", "qty": 1, "rate": 800.00, "order": 1, "taxname": [], "unit": "" } ] }' # ============================================ # EXEMPLO COMPLETO (múltiplos itens) # ============================================ curl -X POST "https://seu-dominio.com/api/invoices" \ -H "Authorization: Basic $(echo -n 'SEU_TOKEN_AQUI:' | base64)" \ -H "Content-Type: application/json" \ -d '{ "clientid": 1, "number": "FAT-2025-002", "date": "2025-11-04", "currency": 1, "subtotal": 1500.00, "total": 1500.00, "billing_street": "Rua Principal, 456", "billing_city": "Recife", "billing_state": "PE", "billing_zip": "52000-000", "allowed_payment_modes": [1, 2], "duedate": "2025-12-04", "clientnote": "Notas para o cliente", "adminnote": "Recebedor: Dr. João | Conta: 12345 | Tipo: Consulta", "tags": "importado,api,parcela-1", "newitems": [ { "description": "Consulta Médica - Cardiologia", "long_description": "Tipo: Consulta | Executor: Dr. João Silva", "qty": 1, "rate": 800.00, "order": 1, "taxname": [], "unit": "" }, { "description": "Exame de Sangue - Hemograma", "long_description": "Tipo: Exame | Executor: Laboratório XYZ", "qty": 1, "rate": 350.00, "order": 2, "taxname": [], "unit": "" }, { "description": "Raio-X - Tórax", "long_description": "Tipo: Exame | Executor: Clínica ABC", "qty": 1, "rate": 350.00, "order": 3, "taxname": [], "unit": "" } ] }' # ============================================ # COMO USAR: # ============================================ # 1. Substitua "https://seu-dominio.com" pelo seu domínio # 2. Substitua "SEU_TOKEN_AQUI" pelo seu token da API # 3. Ajuste os dados conforme necessário # 4. Execute no terminal ou copie para o n8n # ============================================