Omie ERP Integration
SalesOS integrates with Omie ERP through SalesOS Pay to automate client registration and electronic invoice (NFS-e) generation. This integration is designed for Brazilian companies that need to issue service invoices as part of their sales process.What the Integration Does
The Omie integration handles:- Client registration — Automatically register clients in Omie when deals are closed
- NFS-e issuance — Generate electronic service invoices through Omie’s NFS-e module
- Invoice tracking — Monitor invoice status (processing, issued, cancelled) from within SalesOS
- Service catalog — Access Omie service codes for accurate invoicing
Prerequisites
Before setting up the integration, you need:- An active Omie ERP account with the NFS-e module enabled
- Your company registered with the municipal tax authority (Prefeitura)
- A digital certificate (e-CNPJ) if required by your municipality
- Omie API credentials (App Key and App Secret)
Setup
Get Omie API credentials
In your Omie account, go to Configuracoes > API and create a new application. Copy the App Key and App Secret.
Configure in SalesOS
Go to Admin > Integrations > Omie ERP in SalesOS. Enter your App Key and App Secret.
Map service codes
Select which Omie service codes correspond to your SalesOS products or services. This determines the tax treatment on invoices.
Test the connection
Click Test Connection to verify that SalesOS can communicate with your Omie account. The test checks authentication and retrieves your company information.
How It Works
Client Registration
When a deal is closed in SalesOS, the integration:- Checks if the client already exists in Omie (by CNPJ/CPF)
- If not found, creates a new client record in Omie with:
- Company name and trade name
- CNPJ or CPF
- Address (street, city, state, ZIP)
- Contact information (email, phone)
- Tax identifiers
- Links the Omie client ID to the SalesOS deal record
NFS-e Generation
When an invoice needs to be issued:- SalesOS sends the invoice request to Omie with:
- Client identification (Omie ID)
- Service code and description
- Value and applicable taxes
- Omie processes the NFS-e with the municipal tax authority
- The authorized NFS-e number and verification code are returned to SalesOS
- The invoice PDF becomes available for download in SalesOS
Invoice Status Tracking
SalesOS polls Omie for invoice status updates:| Status | Description |
|---|---|
| Submitted | Invoice request sent to Omie |
| Processing | Omie is processing with the tax authority |
| Issued | NFS-e authorized and number assigned |
| Cancelled | NFS-e was cancelled |
| Error | Processing failed (details available in the error log) |
API Functions
The integration uses the following SalesOS Pay edge functions:| Function | Purpose |
|---|---|
pay-cadastrar-cliente | Register a client in Omie |
pay-emitir-nfse | Issue an NFS-e |
pay-consultar-nfse | Check NFS-e status |
pay-status-nfse | Get detailed NFS-e information |
pay-cancelar-nfse | Cancel an NFS-e |
pay-consultar-servicos | List available service codes |
pay-aguardar-nfse | Wait for NFS-e processing to complete |
Tax Rate Configuration
SalesOS Pay reads tax rates from your billing configuration:- ISS — Municipal service tax (rate set by your municipality)
- PIS — Federal contribution
- COFINS — Federal contribution
- IR — Income tax withholding
- CSLL — Social contribution on net profit
Tax rates are determined by your company’s tax regime (Simples Nacional, Lucro Presumido, or Lucro Real) and the service type. These are configured in Omie and pulled automatically.
Troubleshooting
Common Issues
Connection test fails
Connection test fails
Verify your App Key and App Secret are correct. Ensure your Omie account is active and the API module is enabled.
Client registration fails
Client registration fails
Check that the CNPJ/CPF is valid and properly formatted. Ensure all required address fields are filled in the SalesOS deal.
NFS-e issuance fails
NFS-e issuance fails
Common causes: missing or invalid service code, client not registered in Omie, tax authority downtime. Check the error details in the invoice log.
NFS-e stuck in processing
NFS-e stuck in processing
Some municipalities have processing delays. The
pay-aguardar-nfse function polls for up to 5 minutes. If still processing, check the status later or verify with your Prefeitura.
