Clear documents
Clearance is a subprocess of corroboration. In clearance countries, TrustWeaver submits the document to the relevant tax authority on behalf of the supplier.
The document is not returned to your system until the tax authority authorizes it.
Clearance flows are always handled through the corroborate operation on the storage service. There is no direct equivalent in the signing service for clearance operations.
Corroboration with clearance has a precisely defined meaning: An electronic invoice is signed and cleared with the relevant authority on behalf of the supplier. Inbound and delivery scenarios can vary depending on the country of issue. This is distinct from corroboration without clearance, where the calling system defines the meaning of the operation.
The form of the tax authority response varies by country. In some countries, clearance information is embedded in the returned document. For example, a government-issued signature or authorization identifier added to the invoice. In others, the tax authority returns a separate signed response, or generates distinct artifacts such as a reference number or QR code that accompany but are not part of the original document. See Country-specific e-invoicing requirements.
When clearance applies
Clearance is triggered when a clearance-specific signature format is used in the corroborate request. The Compliance Map specifies which signature formats require clearance for each country and document type. The following constraints apply whenever a clearance signature format is used:
-
The signature format can only be used by and for parties in the relevant country.
-
The format is highly specialized and tightly coupled with the invoice document format required by that country.
-
The same invoice can't be processed more than once.
-
Signing can only be performed on behalf of the supplier. Clearance is requested as part of the sign operation.
-
Validation can only be performed on behalf of the buyer.
Corroborate operation and clearance flow
All clearance flows use the corroborate operation on the storage service. Corroboration applies the signature, submits the document to the tax authority for clearance, and produces audit data in a single operation. A separate StoreInvoice call is required to archive the result after corroborate returns.
TrustWeaver may process a corroborate request asynchronously when clearance with a tax authority is required. In this case, the response includes an AsyncState element that must be used in subsequent polling requests. For details on the asynchronous processing behavior, see About the Corroborate operation.
For individual signing keys required by specific countries and document formats, such as the Mexican CFDI or the South Korean invoices, provide the key using one of two approaches in CorroborationSpec:
- Key references
-
Include one or more
tac:Referencevalues in theKeyReferenceselement. Each reference is a 32-digit hexadecimal identifier of a key stored using the StoreCryptoKey operation. - Branch key
-
Set
UseBranchKeytotrueand include the party'sCountryCodeandTaxIdinSenderInfo. TrustWeaver looks up the registered branch for that tax entity and uses its associated key. Don't include explicit key references when using a branch key.
Prerequisites for clearance operations
Before submitting a document for clearance, make sure that:
-
You have a valid client certificate configured for storage service access.
-
The storage section for the signing or validating party is registered and enabled. See Configure storage sections.
-
If the operation requires individual signing keys such as the Mexican CFDI or the South Korean invoices, the keys are stored in the correct storage section. See About stored cryptographic keys.
-
If the operation requires branch registration, the relevant branch is registered for the invoicing party. Branch registration requirements vary by country:
Country Section registration required Branch registration required Notes Mexico Yes Yes Branch holds the individual signing key. India Yes Yes Branch holds GST portal credentials for IRP access. South Korea Yes Yes Branch holds the private signing key. Italy Yes No Signing key is Sovos-managed; no branch needed. Turkey Yes No Signing is handled without a party-specific key.
Country-specific requirements
The clearance process varies by country. Each clearance country has specific document format requirements, branch registration prerequisites, and in some cases country-specific API parameters.
Clearance response and document status
When TrustWeaver submits a document for clearance, the document status changes to pending until the tax authority responds. After the tax authority approves the document, the status changes to cleared and the document is legally valid. If the tax authority rejects the document, your system must resolve the rejection and resubmit. For the full list of status values and error codes, see Error handling and status codes.
About the corroborate operation
Using individual signing keys
For some countries and document formats such as the Mexican CFDI and the South Korean invoices, TrustWeaver requires a cryptographic key belonging to the signing party rather than a Sovos-managed key. Provide the key using one of the following approaches in CorroborationSpec:
- Key references
-
Include one or more
tac:Referencevalues in theKeyReferenceselement. Each reference is a 32-digit hexadecimal identifier of a key stored using the StoreCryptoKey operation. You can also provide the signing party section name inSenderInfo/Nameto restrict key selection to keys in that section. - Branch key
-
Set
UseBranchKeytotrueand include the party'sCountryCodeandTaxIdinSenderInfo. TrustWeaver looks up the registered branch for that tax entity and uses its associated key. Don't include explicit key references when using a branch key.
Asynchronous processing
TrustWeaver may process a corroborate request asynchronously, such as when clearance with a tax authority is required. When this occurs, the response contains an AsyncState element and other response elements might be absent. Poll by resending the request with the AsyncState value from the previous response and omitting Document, SenderInfo, ReceiverInfo, and CorroborationSpec.
AsyncBehaviorMode in the initial request to indicate that your client can handle asynchronous responses. TrustWeaver makes the final decision on whether to process the request asynchronously.
Error codes
The client error codes are specific to the corroborate operation. Common storage service error codes also apply. See Storage service error codes.
Corroborate a document through the API
Before corroborating a document, make sure that:
-
You have a valid client certificate configured for storage service access.
-
The storage section for the signing or validating party is registered and enabled.
-
If the operation requires individual signing keys such as the Mexican CFDI or the South Korean invoices, the keys are stored in the correct storage section.
-
If the operation involves clearance, the relevant branch is registered for the invoicing party.
-
To confirm a trading partner's tax identifier before storing, use Validate a tax identifier through the API.
The corroborate operation signs and validates a document and creates long-term audit data on behalf of one or more transacting parties. Use it when the storage service must handle the signature operation, such as when individual party keys or clearance flows are involved.
