Submit TicketBAI
Submit TicketBAI with the B2Brouter API
B2Brouter provides a convenient API for submitting TicketBAI tax reports so you can easily comply with the legislation of the three Basque Tax Authorities (Araba, Bizkaia, and Gipuzkoa). Our API abstracts away the differences between them and offers you an unified interface that is fully compliant with all three Tax Authorities. You can check the status of B2Brouter as "software garante" in all three Tax Authorities: Araba, Bizkaia, Gipuzkoa.
With the B2Brouter API, you can manage the submission of TicketBAIs in two ways:
- Delegate the generation of TicketBAI to B2Brouter
- Generate yourself the XML TicketBAI file
Delegate the generation of TicketBAI to B2Brouter
This is the default and recommend way of processing tax reports. You will only have to worry about you issued invoices, we'll take care of generating and sending the TicketBAIs.
Configure your B2Brouter account
First, you need to set up the Tax Authority that has to receive your tax reports in you account configuration at B2Brouter. Please check the documentation on how to set up your account, and specify the Tax Authority details in the Tax declaration section.
Once you have configured your tax declarations, setting up any of the Basque Tax Authorities as receivers, a TicketBAI will be generated automatically, and send to the Tax Authority, for each invoice you issue via B2Brouter.
Create issued invoices
Second, you create an invoice at B2Brouter using our API. You have two options:
- Create an issued invoice using a JSON payload
- Create an issued invoice by importing a supported file format
Generate the TicketBAI associated with the issued invoice
If you issued automatically the invoice that you just created, that is, you set the parameter send_after_import in the API call that created the issued invoice. The TicketBAI corresponding to the invoice you just created will be generated automatically and send to the Tax Authority.
Alternatively, if you issue your invoices using other means, or want more control over the issuing process, you can explicitly generate the TicketBAI corresponding to any issued invoice imported in B2Brouter by explicitly calling the generate tax report method.
Check the status of the TicketBAI
The process of sending tax reports to the Basque Tax Authorities is asynchronous, that is, we generate, sign, chain, and send the TicketBAI in a background process.
You will have to check the status of the TicketBAI we send in your behalf in order to be able to take the necessary actions in case any error or warning is issued by the Tax Authority. You can either:
- Check a specific Tax Report by using its ID. Usually this method is more convenient if you explicitly called the generate tax report method. As it will return the ID of the tax report.
- Get a list of tax reports associated with an invoice ID by calling the list tax reports method. Usually this method is more convenient if you import and issue automatically the invoices. As the invoice ID will be returned after creating an invoice using either a JSON payload or a supported file format.
Because of the asynchronous nature of the tax report sending process, there is no guarantee that when you check the status of the tax reports it will already have the response of the Tax Authority. It usually takes a few seconds to complete the transaction. You will know that the transaction is complete if the response of the check of the status of the tax report has an status registered or error. We recommend you retry the status check until you get a final state on your TicketBAI. We recommend implementing an exponential backoff strategy for the retries.
Generate yourself the XML TicketBAI file
If your prefer to generate yourself the XML file of the TicketBAI, we can process them for you. That is, we can sign, chain, and send them to the corresponding Tax Authority. We can also send you back the response of the Tax Authority, by for example, sending an ApplicationResponse or equivalent document.
Please contact sales if you are interested in this method of processing tax reports, and we will discuss the pricing and the technical details.
Updated 4 months ago