Pular para o conteúdo
Specialty · tax integration

Tax integration in SAP: what the tax layer tax must define before the interface

Every invoice issued, every event received and every file sent to the tax authority goes through an integration. The technology, whether SAP BTP, Integration Suite or an API, is the project's choice. What travels, under which rule and with what proof is a tax decision.

Versão em português
Index

Choose the entry point for your role

Four entry points, one per role, straight to the block that answers your question.

01Tax and accounting

Which fields, rules and proofs the interface must carry, what to do on a rejection and who makes the tax decision.

Go to the section

02IT, Basis and integrator

The channel of each destination, the retry and idempotency design, the certificates, the environments and the transports.

Go to the section

03Management and decision

What each party does, the ECC, S/4HANA and cloud scenarios, an example outage and how to start.

Go to the section

04Audit and security

Observability, proof trail, retention, data protection and what cannot depend only on the platform log.

Go to the section
Direct links
The direct answer

Tax integration is the content, not the plumbing

In one sentence

Tax integration is the exchange of documents, events and files between SAP and whoever must receive them, with the tax authority at the center. What makes it tax is the content that travels and the proof that stays, not the protocol used.

Layer 1

Source

SAP and the master data that feed the document: tax master record, tax determination, numbering. Most rejections start here, before any interface.

Layer 2

Transport

The platform that carries the message: SAP Integration Suite, a direct API (application programming interface) or a file. It handles protocol, security, retry and monitoring. This is the layer of the integrator and the technical team.

Layer 3

Destination

The state authorizer of the NF-e (electronic invoice), the national NFS-e environment (electronic service invoice), partners and internal systems. The destination sets the channel, layout and deadline, and SAP does not negotiate them.

Separating the layers changes the project conversation. When an invoice is rejected, the first question is in which layer the error started: in the source data, in the transport or at the destination. Without this split, the technical and tax teams argue about whose problem it is before investigating.

i

Where the problems show up

Almost every rejection, rework and assessment difference starts at the border between the layers. The technical design is right, but nobody defined the tax rule it must carry. DFSpro works on the source and on the proof of the result. The transport stays with the integrator.

The components

What each platform component does and the tax question for each

Eight components show up in tax projects. Knowing what each one does avoids putting a tax rule where nobody looks.

ComponentWhat it is, according to SAPTax question
SAP BTPAn offering that brings together application development, process automation, integration, data and artificial intelligence (SAP BTP, SAP's business technology platform).Which new tax rule will live outside the ERP (enterprise resource planning) core, and who answers for it?
SAP Integration SuiteAn integration platform with Cloud Integration, API Management and API Composition, Advanced Event Mesh, Integration Advisor, Trading Partner Management, Open Connectors, Data Space Integration, Migration Assessment and Edge Integration Cell.Which tax flow goes through it and which stays outside?
Cloud IntegrationConnects cloud and on-premise applications and processes messages between companies or areas, in application-to-application (A2A) and business-to-business (B2B) scenarios. It is part of the Integration Suite service plan and is not available separately.Which tax message travels, in what format, and what happens when it fails?
API ManagementPublishes, protects and governs APIs, with traffic policies such as cache, quotas and spike control.Which tax data can be exposed, to whom and with what access control?
Advanced Event MeshEvent-based messaging: the publisher delivers the message to a destination, usually a queue, and the subscriber consumes it.Which tax fact becomes an event, and who can subscribe?
Edge Integration CellAn optional hybrid runtime: it designs and monitors in the cloud and runs in the customer's private landscape, for security or compliance needs.Is there a requirement that the tax data stay in an environment the company controls?
Cloud ConnectorAn agent that runs in the customer's network and links SAP BTP applications to on-premise systems, without exposing the whole internal network.Which on-premise system is visible to the cloud, and with what access control?
Migration AssessmentHelps move off older SAP Process Orchestration environments.Which old tax interfaces exist, and what does each deliver today?

Three questions settle most designs: where the tax rule lives, who gets the alert when the message fails and where the proof sits after sending. Whoever answers them picks the component, not the other way around.

API or file

Who picks the channel: almost always the destination

To talk to the tax authority, the channel is already set. The authorizer publishes the service and SAP adapts. The real choice exists at the internal ends.

NF-e and NFC-e

Communication channel. SOAP 1.2 web service (an XML message protocol, XML being the document markup language) over TLS 1.2 or higher (secure connection protocol), with mutual certificate authentication.

Tax decision. Who transmits, with which certificate, and how the result returns to the document.

Source. MOC, section 4.2.2

NFS-e national standard

Communication channel. API of the National NFS-e System: POST to generate the invoice from the DPS (service provision declaration), GET to query and HEAD, a method that only confirms, to learn whether a DPS has already become an invoice.

Tax decision. Building and signing the DPS, handling the synchronous rejection and querying before resending.

Source. National Issuer API manuals

CT-e and MDF-e

Communication channel. Their own manuals, in the same family of online manuals as the electronic tax documents, with the layout and events of each document.

Tax decision. The link to the goods invoice, the transport contingency and the events.

Source. CT-e and MDF-e in SAP

SPED, eSocial and EFD-Reinf

Communication channel. A file or a batch of events, depending on the obligation, with its own validation and receipt. SPED is the Public Digital Bookkeeping System.

Tax decision. Who validates, who transmits and where the receipt is kept.

Source. Ancillary obligations and SPED

Partners and internal systems

Communication channel. Whatever the project agrees: HTTPS, SOAP, OData, SFTP (secure file transfer), IDoc (SAP's intermediate document), RFC (remote function call) or a queue.

Tax decision. Standard, authentication, owner of the monitoring and proof. It is the only choice that truly belongs to the project.

Source. Integration Suite adapters

The useful question is not which protocol is more modern, but which service the destination offers and what SAP must return to the user when it answers. For partners, the criteria become volume, processing window and who keeps the receipt.

When a web service or API fits

  • The tax answer comes back in the same call, with a rejection code.
  • You can query the status of the document and resend safely.
  • It needs a valid certificate and stable connectivity to the destination.

When a file or batch fits

  • The volume is high and the window is fixed.
  • The check happens after sending, with a receipt.
  • It needs proof of delivery and control of duplicate or incomplete files.
Integration patterns

SOAP, OData, events and files: where each one shows up

Integration Suite brings more than 80 standard adapters. In Brazilian tax work, a few patterns make a difference, and each carries its own risk.

PatternWhere it shows up in taxWhat Integration Suite offersTax risk
SOAPCalls to the NF-e and NFC-e authorization services.SOAP adapter, version 1.x, to call and receive web services.Layout version swapped in the message; tax result in the body of the response.
HTTPS and RESTNational NFS-e API and internal APIs.HTTPS adapters (receive) and HTTP (call).HTTP 200 with an error inside; certificate authentication set up wrong.
ODataRead and write in SAP applications that publish OData services.OData adapter, versions 2.0 and 4.0.Exposing more tax data than needed; volume with no paging.
Events and queuesTelling the tax team about a new fact, such as an invoice authorized or cancelled, without coupling systems.Advanced Event Mesh and the JMS queue adapter.Event lost, repeated or out of order.
File and SFTPBatch exchange with partners.SFTP adapters, to send and fetch files.File duplicated, incomplete or with no receipt.
IDoc and RFCInside the SAP ecosystem, above all in ECC.IDoc and RFC adapters; RFC with Cloud Connector links on-premise ABAP systems to the cloud.Tax rule scattered across ABAP exits, hard to monitor.

Choosing the pattern does not solve the tax side. A well-configured SOAP adapter still delivers a wrong invoice if the source data is wrong. That is why the tax risk column weighs more in the project conversation than the list of adapters.

i

Synchronous or asynchronous changes the test

In the NF-e manual, authorization can be synchronous or asynchronous, and the other services are synchronous. In asynchronous mode, the result only comes on a second connection. Each mode needs its own type of test and its own type of alert.

What the tax authority requires

What the NF-e manual requires of an interface

The numbers come from the Taxpayer Guidance Manual (MOC) for the NF-e and the NFC-e (consumer electronic invoice). The SEFAZ, the state Treasury Department, is the one that authorizes the invoice. Each row ends in a decision to take before acceptance testing.

RequirementWhat the manual saysDecision that lands on the interface
CommunicationTLS 1.2 or higher with mutual authentication; SOAP 1.2, Document/Literal style, in the WS-I Basic Profile standard.The chosen platform must accept mutual authentication and SOAP 1.2 for each authorizer.
CertificateICP-Brasil certificate (the Brazilian public key infrastructure), type A1 or A3, with the holder's CNPJ (the Brazilian company tax ID) or CPF. Two uses: signing the message (CNPJ of an establishment of the issuer) and transmitting (CNPJ of whoever is responsible for transmission, which can be another one).Who signs, who transmits and where the private key stays.
BatchUp to 50 NF-e per batch; average size of about 10 KB per invoice. GZip compression with Base64 cuts the message by about 70%, according to the manual's estimate.Batch size, compression and a queue for peaks.
Synchronous or asynchronousSynchronous sending, with no receipt, is valid only if the batch has a single invoice and the SEFAZ offers the mode. In asynchronous mode, the answer brings a receipt and the result comes in another query.SAP must handle both modes.
Result queryWait at least 15 seconds between sending and querying the receipt. Code 105 means batch in processing and 104, batch processed.A configured query interval, not the fastest possible.
Authorizer deadlineThe SEFAZ commit to process the batch within 3 minutes for at least 95% of the 24-hour volume. The batch result stays available for at least 24 hours; after that, only the individual query.An alert when it passes 3 minutes and a plan for what passes 24 hours.
Improper useThe SEFAZ can apply rules against improper use. The manual cites as examples repeating a rejected batch, querying receipts in sequence and querying the same key in a loop, and says new searches for records already delivered are rejected with error 656.No blind retry, no query loop.
EnvironmentsAcceptance and production, both subject to accreditation. The acceptance invoice has no tax value.Addresses and certificates by environment, never fixed in the design.
Layout versionEvery layout change updates the XML schema, and the version goes in the file name, after a _v.Who follows the technical notes and updates the mapping.

The path of an asynchronous batch

Step 01

Send the batch

A message of up to 50 invoices. Response 103 says the batch was received, with the receipt and the average response time.

→
Step 02

Wait

At least 15 seconds before the first query. Querying earlier only returns 105.

→
Step 03

Query the receipt

A 105 says to query again. A 104 brings the protocol of each invoice.

→
Step 04

Record the result

Authorized, denied or rejected. SAP updates the document and keeps the XML with the protocol.

The manual does not ask for speed: it asks for a minimum wait, queries with an interval and sending in batches. An interface that is too fast comes closest to improper use. The right design respects the authorizer's pace and keeps every answer.

A rejected invoice does not stay in the SEFAZ database: it can be corrected and transmitted again.

What to define

Twelve tax decisions that every interface needs to have

Twelve questions the tax team must be able to answer, interface by interface. They are the basis of the interface's tax contract.

DecisionThe questionIn the sample sheet and what to check
01. Fields and sourceFor each required field of the document, where it comes from in SAP and who maintains the data. A field with no owner becomes a rejection.Sheet. SAP billing and the tax master record.
02. Calculation ruleWhich rule produces each value and at what point it is applied. A rule duplicated in two places diverges sooner or later.Sheet. Tax determination. Check. The calculation rule exists in one place only.
03. Channel and protocolWhich service, in which version, for which destination. The official destination sets the channel, and the design only chooses how to reach it.Sheet. SOAP 1.2 with TLS and mutual authentication, batches of up to 50 invoices, compression decided by the project. Check. The authorizer's address is a parameter by state and by environment.
04. Identity and certificateWho signs, who transmits, where the key stays and who renews it before expiry, for each CNPJ involved.Sheet. Signing with the CNPJ of the issuing establishment and transmission with the certificate of whoever is responsible for it. Check. There is a renewal owner and an expiry date for every certificate, with an early alert.
05. Response and statusHow the tax result returns to SAP and updates the document. The platform status is not enough: the tax code is in the body of the response.Check. The flow reads the tax code in the response, not only the HTTP status.
06. RejectionWhat the user sees, who fixes it, how fast and how the corrected document is resent without duplication.Sheet. Tax team queue with code, cause and owner. Fix at the source and resend as a corrected document.
07. RetryWhen the interface resends on its own and when it stops. A transient failure can repeat, a tax rule rejection cannot.Sheet. Only for a transient failure, with a growing interval and a cap. No retry for a rule rejection.
08. DuplicatesWhich stable identifier prevents two invoices for one sale, and what happens when sending times out with no answer.Sheet. Access key, number and series. Status query by the key before any resend.
09. ContingencyWhen SAP switches destination, how it records the fact and how it regularizes afterward, with an owner and a deadline.Sheet. Entry criterion, mode chosen by the client, destination by state, regularization and deadline. Check. The mode is tested.
10. Events and cancellationHow each event returns to SAP and updates the document, including those that arrive after posting.Check. Owner and evidence defined, as in every row of the sheet.
11. Proof and retentionWhich files are kept, where, for how long and who accesses them, in line with the legal deadline.Sheet. Authorized XML, protocol, events and message identifier, with retention set by the client. Check. Kept for the legal period, outside the platform log.
12. Personal data and accessWho sees the XML, the log and the monitor, and what log level is allowed, in line with the LGPD (Brazil's General Data Protection Law).Sheet. Who accesses the XML and the log, the allowed log level and a record of processing operations. Check. Log level and monitor access defined with the legal team, in line with the LGPD.

The twelve decisions do not have to be made at once. The order that usually works follows the life of the invoice: what comes in, how it goes out, what to do when it fails and what stays on record.

If any answer is "I don't know" or "it depends on the person", there is an operations, audit and continuity risk before the next change. From decision 4 on, each one has its own section.

Tax contract

A one-page sheet, interface by interface

Each interface gets a sheet with the same fields. The sheet becomes the test script and the audit proof. Each row of the sheet answers one of the twelve decisions.

The example is an outbound NF-e model 55, sent to the authorizer of the issuer's state (UF, the Brazilian federative unit), with the address set by parameter and by environment. The integrator and IT answer for the transport. The tax team answers for the content and the rule.

The sheet follows a simple rule: each row needs an owner and evidence. If the row only says what is intended, it is still an intention. When it names the person responsible and the test that proves it, it becomes a contract.

i

The sheet belongs to the client

The example is not a real case. DFSpro helps fill in each row, configures what is system work and proves the result in testing. The decisions in each row belong to the client.

Errors and reprocessing

Resend only what can be resent

Resending everything that failed looks safe and is the most expensive mistake. Each type of failure needs a different response. Ajuste SINIEF 07/05 allows the same file to be transmitted again in three cases: failure of reception or processing, failure of authorship or integrity and failure in reading the number.

Type of failureExampleResend unchanged?Owner
TransientUnstable network, authorizer down, timeout.Yes, after querying the status of the document, with a growing interval.Integration
Tax rule rejectionIncomplete source data, tax inconsistent with the master record.No. Fix at the source and resend as a corrected document.Tax team
Layout rejectionSchema version swapped, required field missing.No, until the mapping is fixed.Integrator, with the tax team
Security failureExpired certificate, untrusted chain, key without permission.No, until the certificate is fixed.Basis and security
Response with apparent successHTTP 200 with the error inside the message.Depends on the tax code in the body.Integration and tax team
Improper useError 656 after repeated searches.No. Stop the loop and fix the cause.Integration

The distinction between a transient failure and a rule rejection is the center of the design. Repeating a transient failure usually clears it on its own. Repeating a rule rejection only reproduces the error, uses up queries and, in the worst case, brings the company close to improper use.

How SAP describes retry

JMS queue

The platform tries again

The message is stored in the queue, the sender receives HTTP 202 and the platform repeats on a temporary failure. The default first interval is 1 minute, doubles with each failure and has a default cap of 60. The channel does not fix a maximum number of attempts.

Data store

Reprocess by query

The failed message is stored, and a dedicated flow queries the repository and resends. It is the alternative to the JMS queue, which SAP does not support in the basic edition of Integration Suite.

Sender

SAP repeats

The retry stays in the sending system, with a growing wait between attempts. In a synchronous scenario, it improves resilience and can increase response time.

i

HTTP 200 does not mean the invoice is authorized

SAP warns that a receiver can return 200 with the error inside the message. If the flow looks only at the HTTP status, it ends as completed and nobody notices. At the authorizer, the tax result is the response code, not the protocol status.

The JMS queue default values apply to a non-exclusive queue; SAP gives its own ranges for an exclusive queue.

Idempotency and duplicates

One invoice, one number, once

An idempotent operation gives the same result when repeated. In tax work, it is what prevents two invoices for one sale. The protection exists in three places, and none is enough alone.

Barrier 1

At the authorizer

The SEFAZ rejects a new request when it finds a duplicate of the natural key: state, issuer CNPJ, series, number, model and environment. A duplicate number is also a cause of rejection in Ajuste SINIEF 07/05. It is the last barrier, not the first.

Barrier 2

On the platform

The step Idempotent Process Call in Cloud Integration detects a message already processed successfully and skips processing. The repository keeps the identifier for 90 days by default, and the check applies only to that instance of the step.

Barrier 3

At the source, in SAP

The access key and the number are created in SAP and identify the invoice. Before resending, the interface queries the status by the key. In the national NFS-e, the equivalent is HEAD by the DPS identifier, which says whether the invoice was already generated.

The three barriers work in layers. The authorizer's protects the tax authority, the platform's protects the destination from repeated messages and the source's protects SAP itself. If the design depends on only one, the failure that slips through becomes a duplicate invoice.

i

SAP itself warns of the limit

For SAP, duplicate detection in the flow is the second-best solution. If the call times out or the destination does not confirm, you cannot know whether the message was processed. Exactly-once delivery requires an idempotent receiver.

Practical rules

  • The idempotency identifier is derived from the tax document (key, number and series), never from a new value on each attempt.
  • After a timeout, the interface queries the status before resending.
  • The repository's 90-day window is shorter than the tax retention period: it prevents duplicates, but proves nothing.
  • Two authorized invoices for one sale is a tax incident. How to treat it is the client's decision; the owner and the cancellation flow must be defined beforehand.
Authentication and digital certificate

The certificate is the company's identity and an expiry date on the calendar

The digital certificate identifies the company to the tax authority. It is also a predictable failure, because it has an expiry date. The decision belongs to whoever governs the tax master record.

What the tax authority requires

  • NF-e: ICP-Brasil certificate, type A1 or A3, with the holder's CNPJ or CPF.
  • The XML signature uses the issuer's certificate. Transmission uses the certificate of whoever is responsible for it, who can have another CNPJ.
  • National NFS-e: the DPS is signed, and the connection to the API uses the requester's digital certificate.
  • In document distribution by the ADN (National Data Environment), the certificate with the same root CNPJ as the queried taxpayer applies.

What the platform stores

  • Cloud Integration has one keystore per tenant, with key pairs and certificates.
  • On the outbound connection, the pair is chosen by alias; without an alias, the system can choose among several pairs the server accepts.
  • Keystore entries do not travel in the content transport: each environment gets its own.
  • The platform does not check the signature of certificates on sending, and root certificates need a manual check.

A certificate expiring is not a technical surprise, it is a process failure. That is why governance comes before configuration: who is warned in advance, who has authority to replace the certificate and how issuing continues during the switch.

Certificate governance questions

  • Who holds each certificate and for which CNPJ?
  • Where is the private key: file, device or service?
  • Who renews it, how early and with what warning?
  • Which interfaces stop if the certificate expires?
  • How do you replace the certificate without stopping issuing?

The certificate health monitor of SAP Cloud ALM covers API Management certificates. For the Cloud Integration keystore, treat the expiry alert as your own process.

See also, the certificate in each case:Automatic inbound NF-eNFS-e national standard
Contingency

Contingency is not a failure: the switch and the return have an owner

Contingency is a planned operating mode. What must be decided is when SAP enters it, where it sends, what is held back and how it regularizes.

Modes

Three paths, no ranking

The manual describes FS-DA, EPEC and SVC and says there is no precedence among them: the issuer can adopt one, some, all, or wait for normalization. The choice belongs to the client, and SAP must support the one it chooses.

SVC

Who turns it on and how SAP knows

The origin SEFAZ activates the SVC when it is unavailable. The company uses the SVC only when the status query of its own service returns 107, service in operation. The field tpEmis, the form of issue, is part of the access key.

Limits

What the SVC does not do

In the SVC, cancellation applies only to invoices authorized by it, and invalidation is not offered. Cancellation requests for invoices from the normal environment, and invalidation requests, are held back for the return. The correction letter was not provided for.

Data read on 19/10/2026 from the NF-e portal and from the MOC (updated up to NT 2026.007 v.1.10, published on 01/10/2026); always confirm at the source before operating. To see whether it changed, open the current version at these two links. The difference between the two sources is the point that needs the most attention: it is marked on the maps, in the list and in each state panel. Each panel shows the state's situation, what changes for issuing, the official pages and our explanations. Choosing the current source is always the client's decision, never the consultancy's. In any contingency situation, checking the official source before operating is required.

States that use it, according to the NF-e portal
ROACAMRRPAAPTOMAPICERNPBPEALSEBAMGESRJSPPRSCRSMSMTGODF
  • SVC-AN (19 states)
  • SVC-RS (8 states)
  • Dashed orange border: the two official sources differ (5 states)
See the 27 states in a list
The 27 states, the situation of each and the destination
StateSituationDetail
Rondônia (RO)uses SVC-AN
Acre (AC)uses SVC-AN
Amazonas (AM)uses SVC-RS
Roraima (RR)uses SVC-AN
Pará (PA)uses SVC-ANThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Amapá (AP)uses SVC-AN
Tocantins (TO)uses SVC-AN
Maranhão (MA)uses SVC-RS
Piauí (PI)uses SVC-ANThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Ceará (CE)uses SVC-ANThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Rio Grande do Norte (RN)uses SVC-ANThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Paraíba (PB)uses SVC-AN
Pernambuco (PE)uses SVC-RS
Alagoas (AL)uses SVC-AN
Sergipe (SE)uses SVC-AN
Bahia (BA)uses SVC-RS
Minas Gerais (MG)uses SVC-AN
Espírito Santo (ES)uses SVC-ANThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Rio de Janeiro (RJ)uses SVC-AN
São Paulo (SP)uses SVC-AN
Paraná (PR)uses SVC-RS
Santa Catarina (SC)uses SVC-AN
Rio Grande do Sul (RS)uses SVC-AN
Mato Grosso do Sul (MS)uses SVC-RS
Mato Grosso (MT)uses SVC-RS
Goiás (GO)uses SVC-RS
Distrito Federal (DF)uses SVC-AN
States that use it, according to Ato COTEPE 39/2012, reproduced in the MOC
ROACAMRRPAAPTOMAPICERNPBPEALSEBAMGESRJSPPRSCRSMSMTGODF
  • SVC-AN (14 states)
  • SVC-RS (13 states)
  • Dashed orange border: the two official sources differ (5 states)
See the 27 states in a list
The 27 states, the situation of each and the destination
StateSituationDetail
Rondônia (RO)uses SVC-AN
Acre (AC)uses SVC-AN
Amazonas (AM)uses SVC-RS
Roraima (RR)uses SVC-AN
Pará (PA)uses SVC-RSThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Amapá (AP)uses SVC-AN
Tocantins (TO)uses SVC-AN
Maranhão (MA)uses SVC-RS
Piauí (PI)uses SVC-RSThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Ceará (CE)uses SVC-RSThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Rio Grande do Norte (RN)uses SVC-RSThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Paraíba (PB)uses SVC-AN
Pernambuco (PE)uses SVC-RS
Alagoas (AL)uses SVC-AN
Sergipe (SE)uses SVC-AN
Bahia (BA)uses SVC-RS
Minas Gerais (MG)uses SVC-AN
Espírito Santo (ES)uses SVC-RSThe two official sources differ (NF-e portal: SVC-AN; Ato COTEPE 39/2012: SVC-RS). The decision on which one to treat as current for the operation belongs to the client.
Rio de Janeiro (RJ)uses SVC-AN
São Paulo (SP)uses SVC-AN
Paraná (PR)uses SVC-RS
Santa Catarina (SC)uses SVC-AN
Rio Grande do Sul (RS)uses SVC-AN
Mato Grosso do Sul (MS)uses SVC-RS
Mato Grosso (MT)uses SVC-RS
Goiás (GO)uses SVC-RS
Distrito Federal (DF)uses SVC-AN

The point of attention is the return, not the entry. Entering contingency is usually a quick decision. Regularizing means checking invoice by invoice, resending only what the rule asks and closing the record with a protocol and a time, and that is where interfaces with no owner lose control.

i

Two official sources, two lists

The manual reproduces Ato COTEPE 39/2012, which puts CE, ES, PA, PI and RN on SVC-RS. The current list on the portal puts them on SVC-AN. Confirm on the current portal before setting up.

The choice of contingency mode is the client's. For CT-e and MDF-e, the rules are their own and are on the CT-e and MDF-e page.

Observability and audit trail

Monitoring the message is one thing, proving the invoice is another

The platform monitor shows what happened to the message. The tax proof is the authorized XML, the protocol and the events, kept for the period the law requires.

What the platform keeps

  • Monitoring data: 30 days, by default.
  • Message content saved in dedicated steps: 30 days, by default, configurable.
  • Data store: default expiry of 30 days, maximum of 180.
  • Idempotency repository: 90 days.
  • Longer archiving requires the customer's CMS (content management) system, which the customer monitors itself.

What the tax authority expects from the issuer

  • The NF-e is kept in a digital file, under the issuer's custody and responsibility, for the period set by tax law, even outside the company (Ajuste SINIEF 07/05, tenth clause).
  • Books and receipts are kept until the tax credits expire under the statute of limitations (CTN, art. 195, sole paragraph).
  • A rejected invoice is not archived at the tax administration for consultation. The record of the rejection, if useful, is the issuer's.

The difference is time. By default the platform keeps what helps operations for a few weeks, and the tax obligation goes far beyond that. That is why the proof repository must exist outside the log, with an owner and an access policy.

What each message status means

COMPLETED

SAP definition. Message delivered to the receiver successfully.

Tax reading. Delivered is not authorized. Check the tax code in the response.

RETRY

SAP definition. There was an error and an automatic retry started.

Tax reading. Queue in progress. Define until when and who watches.

ESCALATED

SAP definition. There was an error and no retry was triggered.

Tax reading. Falls to the interface owner.

FAILED

SAP definition. Final failure: no delivery and no retry possible.

Tax reading. Goes to the tax team queue with a code and an owner.

ABANDONED

SAP definition. Processing interrupted or log not updated for a long time.

Tax reading. It may start moving again. Confirm the status before resending.

CANCELLED

SAP definition. JMS queue entry cancelled manually.

Tax reading. Record who cancelled it and why.

i

Log level also decides the proof

With the log level Error and a retry configured, the final successful retry is not recorded, and the status can stay at Retry or Failed even though the message was delivered. Set the level per interface and fill in the application identifier (SAP_ApplicationID) with the invoice key, to find the message by it.

Environments and transports

From development to production, what changes is tax

The same design runs in different environments, and almost everything that differs is tax: address, certificate, master data. Treating this as a parameter avoids fixing things by hand after the transport.

What changesDevelopment and testProductionRule
Authorizer addressAcceptance, by state.Production, by state.Externalized parameter. The portal publishes one address per state and per service, in different formats: the one for Amazonas ends in NfeAutorizacao4 and the one for Bahia in NFeAutorizacao4.asmx.
CertificateTest or acceptance.The issuer's.Keystore entries are not transported. Configure in each environment.
OAuth and other credentialsBy environment.By environment.The credential artifact is deployed again at the destination, preferably with the same alias.
Tax master dataSample.Complete.Without master data that resembles the real thing, the rule test proves nothing.
Invoices issuedNo tax value.With tax value.Testing in production because of an application failure can trigger the improper-use control.

The test most often forgotten is the environment test. The interface works in acceptance because the address, the certificate and the master data were test ones, and it fails on the first production invoice. Treating each difference as a parameter, with an owner, avoids that kind of surprise.

How SAP recommends transporting the content

Recommended

Transport Management Service

Cloud service with routes, roles, approvals and a record. SAP points to it when CTS+ is not installed and for those planning projects with SAP BTP services.

Recommended

CTS+

An option for those who already have CTS+ installed and in use for other systems. It also automates routes, approvals and records, and accepts content packaged as MTAR.

Exception only

Export and import by hand

No control or record of who transported what and when. SAP points to its use only as an exception, such as an urgent fix with the transport system stopped.

Anything specific to the environment stays in externalized parameters: after the transport, only the parameters are configured, without editing the flow.

Tests and evidence

Prove the behavior, not just the run

A tax interface has passed the test when the value, status and document in SAP match the tax result. Running without errors does not prove that.

The matrix is the acceptance contract of the tax layer. Each case ends in evidence that an auditor can open, not in "it worked". The rejection and contingency cases reveal the most gaps, because they need a decision, not just configuration.

01. Normal authorization

Trigger. Valid invoice in acceptance.

Check in SAP. Document authorized, with a protocol.

Evidence. Authorized XML, protocol and message ID.

02. Rule rejection

Trigger. Incomplete tax data, on purpose.

Check in SAP. Status rejected with a code, in the tax team queue.

Evidence. Response with the code and the recorded cause.

03. Layout rejection

Trigger. Required field missing.

Check in SAP. Error in the mapping, with no automatic resend.

Evidence. Error message and log.

04. Timeout and retry

Trigger. Drop the connection in the middle of sending.

Check in SAP. Status query before resending, and a single invoice.

Evidence. Log of the attempts and the key queried.

05. Duplicates

Trigger. Send the same invoice twice.

Check in SAP. Second attempt discarded or rejected.

Evidence. Idempotency ID and response.

06. Contingency

Trigger. Simulate the authorizer being unavailable.

Check in SAP. Invoice marked as contingency and regularized afterward.

Evidence. Record of entry and exit.

07. Cancellation and event

Trigger. Cancel an authorized invoice.

Check in SAP. Event recorded and document updated.

Evidence. Event protocol.

08. Expired certificate

Trigger. Use an expired test certificate.

Check in SAP. A clear failure, an alert to the owner, no resend loop.

Evidence. Alert and log.

09. New layout

Trigger. Apply the new schema version.

Check in SAP. Invoice with the new fields validated.

Evidence. Result of the regression test.

10. Load

Trigger. Batches of 50 invoices at peak.

Check in SAP. No growing queue and no error 656.

Evidence. Times and batch count.

i

Design, configure and prove

DFSpro designs the case, configures the test environment and proves the result with the evidence for each row. The tax conclusion, such as how to treat two authorized invoices, belongs to the client.

The CT-e, NFS-e and inbound invoice scenarios have their own matrices on the page for each topic.

Performance and volumes

Size for the peak, not for the average

The official numbers help size the queue, the batch and the query interval. The peak of a contingency is the case that breaks a design calculated on the average.

Tax authority

What the manual promises

A batch of up to 50 invoices, about 10 KB each, a response within 3 minutes for 95% of the volume, the batch result for 24 hours and the average response time of the last 5 minutes on the receipt. On the status query, the manual asks for at least 3 minutes between queries in a loop.

Queue

Limits of the JMS queues

By default, 30 queues, 9.3 GB of capacity and 150 transactions. By self-service, the maximum is 100 queues, 30 GB and 500 transactions. A full queue at the peak of a contingency is a design risk, not bad luck.

Inbound

Message size

HTTP adapters accept a limit on body size, and a larger message is stopped before the next steps. SAP recommends setting this limit so the flow runs under known conditions.

The peak, not the average, decides the design. An outage piles up invoices that SAP keeps generating, and the catch-up must fit the batches and intervals in the manual without falling into improper use.

Simulate the peak

How many batches an outage leaves in the queue

An illustrative example: it shows the order of magnitude, not an authorizer limit. Change the values and see the effect.

1,200invoices piled up
24batches of up to 50 invoices
11.7 MBvolume uncompressed
3.5 MBvolume with GZip, estimated
24 per hourbatches to clear the queue in 1 hour

MOC parameters: a batch of up to 50 NF-e, about 10 KB per invoice and a reduction of about 70% with GZip, according to the manual's estimate.

Security and data protection

The XML holds personal data, the log too

Tax documents can identify individuals by CPF, such as an issuer who is an individual. Handling that data in the integration is processing of personal data, and the LGPD reaches the XML, the log and the file.

LGPD articleWhat it saysDecision on the interface
Art. 6Among the principles of processing are purpose, necessity and security.Each field and each copy of the XML has a purpose. A log with full content needs a reason.
Art. 7, IIProcessing is allowed to meet a legal or regulatory obligation by the controller.It usually supports issuing, receiving and keeping the tax document. The conclusion for each case belongs to the client's legal team.
Art. 16, IAfter processing ends, retention is allowed to meet a legal or regulatory obligation.Explains why the XML is kept and ties retention to the tax period.
Art. 37The controller and the operator keep a record of personal data processing operations.Record who accessed it and what the interface did with the data.
Art. 46The agents adopt technical and administrative security measures.Access control on the monitor, encryption and a log-level policy.
Art. 48The controller reports a security incident to the national authority and to the data subject, when there is relevant risk or harm.A plan for a leak through log, file or integration.

The LGPD does not stop you from keeping the XML: the tax obligation is the basis for it. What it asks for is care with what is copied beyond what is needed, with who has access and with the trail of operations. That is where the integration tends to create risk, for example in logs with the full content.

What the SAP platform documents about stored data

Log

Levels that record content

The level Trace records the message content and expires in 10 minutes by default, with the content kept for 1 hour. The Debug level expires in 24 hours, and SAP recommends it only in development and test.

At rest

Encrypted content

Message content can be stored encrypted, with 256-bit AES. The key is unique per tenant and renewed periodically. It is a setting, not the default.

Archive

Archiving in the CMS

In archiving, the content goes to the customer's CMS system. Even if the persistence step saves it encrypted, in the CMS it is not encrypted.

Content

What goes into the log

SAP recommends listing what goes into the log, not what stays out. Logging all headers can leak the authorization header, visible in the monitor.

The legal basis and the framing of each processing activity are the client's decision, as controller, with its legal team.

Scenarios

ECC, S/4HANA and cloud: where tax integration lives

The same tax requirement calls for different designs depending on the environment: what changes is where the interface lives, who runs it and which official documentation describes it, not the obligation.

SAP ECC, on premise

Location. On-premise ERP linked to the cloud through Cloud Connector, with RFC or another adapter, or a fully on-premise integration.

What the documentation says. Cloud Connector links SAP BTP applications to on-premise systems, and the RFC adapter is the standard interface to integrate on-premise ABAP systems with the cloud through it.

Tax team check. Which ABAP exits and interfaces touch tax, and where the tax rule of each one lives.

SAP S/4HANA, on premise or Private Edition

Location. Standard product interfaces plus extensions, in line with Clean Core.

Tax team check. Which tax extensions exist and what Clean Core level they belong to.

SAP S/4HANA Cloud, Public Edition

Location. Integration Suite as a bridge to external services, such as tax engines.

Tax team check. Who provides the calculation, how the result returns to the document and how it is proved.

Issuing and receiving through DRC

Location. An SAP BTP service. DRC (SAP Document and Reporting Compliance) has an option to issue electronic tax documents in Brazil.

What the documentation says. The initial setup of the issuing option for Brazil calls for a subaccount in SAP BTP with Cloud Foundry, an Outbound nota fiscal license, a service instance and a service key.

Tax team check. Who owns the subaccount, the instance and the service key, and who receives the service notices.

GUEPARDO Tax, from NTT DATA

Location. Depends on the design by NTT DATA and the integrator.

What the documentation says. The NTT DATA page cites SAP certifications for the product, among them those for DRC and TDF (Tax Declaration Framework).

Tax team check. Ask NTT DATA for the integration diagram and the monitoring points.

i

The scenario is the client's decision

The choice between ECC, S/4HANA and cloud, and between integrating directly or through the platform, belongs to the client and the integrator. The tax layer comes in to say what each path must deliver.

The end of GRC NF-e and the role of DRC are on the page about migrating from GRC NF-e to DRC.

Who decides what

The division of work between client, integrator and DFSpro

The tax decision and the architecture decision belong to the client. The integrator answers for the transport and the infrastructure. DFSpro works on the tax layer.

When the division is not written down, the same failure has two owners or none. The table makes explicit who decides, who executes and where DFSpro proves the result, so that the project conversation starts from an agreement and not from an assumption.

TopicClientIntegrator and ITDFSpro
Tax position and rule appliedDecides and takes responsibility.Implements what was decided.Turns it into a system rule and proves the result.
Platform and channelDecides, with the integrator.Designs and runs.Says what each path must deliver on the tax side.
Certificates and keysDefines holder and owner.Installs, protects and renews.Maps the use by CNPJ and sets the expiry alert.
Contingency modeChooses.Implements the switch.Designs the criterion and tests the regularization.
Retry and idempotencyApproves the risk.Implements it in the flow.Defines the tax rule and proves it with a test.
Retention and data protectionDecides as controller, with the legal team.Applies access, encryption and log.Points out what the tax authority requires to keep and tests access.
Tax ABAP codeApproves the rule.Reviews overall technical quality.Develops the tax scope, within Clean Core.
Acceptance and go-liveAccepts the result.Runs the technical plan.Runs the tax scenarios and delivers the evidence.
i

Limit of our role

DFSpro does not decide the tax position, does not choose the integration platform and does not replace the integrator in the overall architecture. It does not operate the client's certificate or take on the issuer's responsibility to the tax authority. It designs, configures and proves the behavior of the system, so the client can decide with evidence.

An example

Four hours of outage, step by step

A company whose state authorizer is down for the afternoon. SAP keeps invoicing. What the interface must do at each moment.

01

Detect

The service status query returns 108 or 109, or the connection times out. The interface respects the 3-minute minimum interval in the manual and does not query in a loop.

02

Decide

The criterion written by the client says when to enter contingency. If the state's SVC is in operation, with status 107, SAP switches the destination.

03

Issue in contingency

Invoices go out marked as contingency. Those that had no answer are queried by key before any resend.

04

Hold back what the SVC does not do

Cancellations of invoices from the normal environment and invalidations requested in this period are held back for the return.

05

Regularize

With the authorizer back, the team checks each pending invoice, resends only what the rule asks and closes the record with a protocol and a time.

The example has no client numbers or project deadlines: it serves to rehearse the sequence of decisions. A company that can tell this story with its own systems and owners has the interface ready for contingency.

i

The proof at the end

The list of invoices by status, the record of the decision to enter and leave contingency and the XML of each invoice. The entry deadline and the mode belong to the client.

Illustrative example, no real client.

Warning signs

When tax integration calls for a second look

Nine signs that repeat in tax integration projects.

SignLikely causeCheck
Authorizer address fixed in the designA change of state, environment or contingency breaks the interface.Whether the address is a parameter by state and by environment.
Same tax rule in the ERP and in the integrationDuplicated rule with different results.Where the rule lives and which copy counts.
Rejections fixed by someone who does not know the tax ruleNo tax owner for the rejection queue.Who fixes it, and whether the cause is recorded.
Flow completed, invoice not authorizedHTTP 200 with the error inside the response.Whether the flow reads the tax code in the body.
Same sending repeated after a timeoutNo status query before resending.Whether the identifier is stable and whether there is a query by key.
No contingency or cancellation testOnly the happy path was tested.The test matrix and the evidence.
Nobody knows which interfaces touch taxNo inventory.The list of interfaces, with destination, owner and frequency.
Authorized XML in a single place, with no audit accessNo proof trail.Where the XML sits, for how long and who accesses it.
Certificate expires and issuing stopsNo expiry map and no owner.Expiry date per certificate and a replacement plan.

Any one of these points, alone, already justifies a review before the next update or migration. The earlier the flaw appears, the fewer invoices go out with a problem.

Checklist

Before going to production, check the whole

If every item has an answer with evidence, the interface is ready from the tax point of view. If one does not, it becomes the first item of the plan. The points of each decision are in the twelve decisions. These apply to the whole.

  • There is an inventory of the interfaces that touch tax, with destination, owner and frequency.
  • Each interface has the tax contract sheet filled in and approved by the client.
  • The test matrix was run and the evidence for each case is filed.
How we work

The tax layer of the integration in four steps

The same method serves one interface or an inventory of fifty. What changes is the size of the list.

01

Inventory

List each interface that touches tax: destination, document, frequency, owner and data owner. Deliverable: the inventory.

02

Tax contract

For each interface, record required fields, data source, rule applied and rejection handling. Deliverable: the sheet for each interface.

03

Test scenarios

Build real cases of operation, rejection, contingency and cancellation, and validate value and status, not just the run. Deliverable: the test matrix.

04

Evidence

Define what is kept as proof, where and for how long, with access for audit. Deliverable: the evidence dossier.

The work is in the tax layer, which includes tax ABAP development, described on the page about ABAP and tax customization in SAP. The overall architecture and the rest of the project stay with whoever integrates the project.

Related pages

Where this topic connects

Integration is the common point of several topics. Each page covers one of them in depth.

Electronic tax documents

Issuing and receiving electronic documents, the failure points and what the tax layer checks at each step.

See page

Automatic inbound and events

Document distribution, NSU, recipient acknowledgment and cancellations that arrive after posting.

See page

NFS-e national standard

The DPS, the National System APIs, the ADN and coexistence with municipal standards.

See page

CT-e and MDF-e

Transport, its own contingency and the link between the transport document and the goods invoice.

See page

From GRC NF-e to DRC

What migrates, what goes missing and how to separate the document layer from the calculation layer.

See page

SAP TDF

How the SPED report is born in the Tax Declaration Framework, the periods, the messaging and the rectification.

See page

ABAP and tax customization

The tax scope of ABAP development, ATC and maintenance of tax extensions.

See page

Tax Clean Core

How to classify and maintain tax extensions, and why every tax interface is also an extension.

See page

Tax reform, CBS and IBS

The new fields on documents, the calendar and what changes in the layout the interface transmits.

See page

Sources

Official sources

Official SAP documentation, tax authority manuals and rules, and the legislation each fact rests on.

NTT DATA

  • GUEPARDO Tax, tax softwareNTT DATA, page read on 16/10/2026

Official pages change. Confirm at the source before deciding. The SAP documentation pages come from the SAP-docs repository, which publishes the text of the official documentation.

Frequently asked questions

Frequently asked questions about tax integration

01What is tax integration in SAP?+

It is the exchange of data and documents between SAP and everyone involved in the tax operation: NF-e authorizers, the national NFS-e environment, partners and internal systems. What makes it tax is the content that travels, the rule that creates it and the proof that stays, not the technology used.

02What is the difference between SAP BTP and SAP Integration Suite?+

According to SAP documentation, SAP BTP is the offering that brings together application development, automation, integration, data and artificial intelligence. SAP Integration Suite is the integration platform available in it, with Cloud Integration, API Management and other capabilities.

03Is Cloud Integration sold separately from Integration Suite?+

No. The Cloud Integration documentation states that it is part of the Integration Suite service plan and is not available separately.

04Does every company need Integration Suite to issue NF-e?+

Not necessarily. The path depends on the tax solution adopted and the project architecture, and the choice belongs to the client and the integrator. The NF-e manual requires SOAP 1.2 with mutual authentication and an ICP-Brasil certificate, and any path must deliver that. The role of the tax layer is to say what each path must deliver.

05Who chooses the channel: API, web service or file?+

With the tax authority, the destination. The NF-e authorizer publishes SOAP web services, and the national NFS-e publishes APIs. The choice exists at the internal ends and with partners, and belongs to the project. The section on channels gives the source for each destination.

06What changes when the state authorizer is virtual?+

The NF-e portal says some states use the Virtual SEFAZ (SVAN or SVRS). The portal lists Maranhão on SVAN and a list of states on SVRS. For the integration, the destination address depends on the issuer's state and must be a parameter, not a fixed value in the design.

07How does contingency work and who decides?+

The manual describes three modes, FS-DA, EPEC and SVC, with no ranking among them. The choice belongs to the client. The SVC applies only when the origin SEFAZ activates it, and the company uses it only when its status query returns 107. SAP must tell the contingency invoice apart, handle what the SVC does not do and regularize afterward.

08Can I automatically resend an invoice that failed?+

Only when the failure is transient, such as network or unavailability, and after querying the status of the document. A tax rule rejection needs a fix at the source. The NF-e manual cites resending a rejected batch in a loop as an example of improper use, which the SEFAZ can block.

09How do I avoid two authorized invoices for the same sale?+

With three barriers: the stable identifier of the document in SAP, the status query before resending and the duplicate check on the platform, such as the Idempotent Process Call in Cloud Integration. SAP says that detection on the platform is the second-best solution, because a timeout leaves doubt about what was processed.

10Who looks after the digital certificate in the integration?+

Installation and technical protection stay with the integrator and the Basis team. Governance, that is, who holds it, who renews it and which interfaces stop at expiry, is the client's decision. DFSpro helps map the use by CNPJ and test the certificate failure.

11For how long do the platform logs serve as proof?+

They do not serve as long-term tax proof. According to SAP, monitoring data stays 30 days by default, and longer archiving requires the customer's CMS system. The proof is the authorized XML, the protocol and the events, kept for the period set by tax law, which the client defines with its accounting and legal teams.

12What should I test before going to production?+

Authorization, rule and layout rejection, timeout, duplicates, contingency, cancellation, expired certificate, a new layout version and a load at peak. The tests section has the matrix with the evidence for each case.

13Does the integration change with the tax reform?+

Yes, in the layout. The National NF-e Portal lists technical notes adapting the NF-e and NFC-e layouts to the Consumption Tax Reform, and each layout change updates the XML schema. The interface needs a process to follow the versions. The fields and the calendar are on the page about tax reform, CBS and IBS.

14How does the integration relate to inbound supplier invoices and to the NFS-e?+

Receiving documents from suppliers has its own page, automatic inbound NF-e, CT-e and events, and so does the national NFS-e, NFS-e national standard. Here is what is common to all of them: certificate, retry, duplicates and proof.

15Does DFSpro develop interfaces or ABAP programs?+

Yes, in the tax scope. DFSpro develops enhancements, BAdIs, exits, programs and reports for the tax layer, under tax governance and within Clean Core. The overall architecture stays with the integrator and the client's team.

16Who decides what between the client and DFSpro?+

The tax decision and the architecture decision always belong to the client. DFSpro designs, configures and proves what the system does in the tax layer, with the interface sheet, rules, test cases and evidence. The integrator answers for the transport and the infrastructure.

17How do I keep the integration from breaking on an SAP update?+

By taking an inventory of the tax interfaces, classifying them under the Clean Core model and testing the tax result at each update. The page on tax Clean Core details this model.

18How do I start?+

By listing the interfaces that touch tax, with destination, document, frequency, owner and data owner. The SAP Tax Diagnostic does this survey and shows where the rule, data or proof is fragile. The request is made through the contact page.

Next steps

Learn what your tax integration delivers today

The SAP Tax Diagnostic takes an inventory of the interfaces that touch tax and shows where the rule, data or proof is fragile.