belvo.resources.tax_declarations
1from typing import Dict, List, Union 2 3from belvo.resources.base import Resource 4 5 6class TaxDeclarations(Resource): 7 endpoint = "/api/tax-declarations/" 8 9 def create( 10 self, 11 link: str, 12 year_from: str, 13 year_to: str, 14 *, 15 attach_pdf: bool = False, 16 save_data: bool = True, 17 raise_exception: bool = False, 18 **kwargs: Dict, 19 ) -> Union[List[Dict], Dict]: 20 """Retrieve tax declaration for a link 21 22 Args: 23 link (str): The fiscal `link.id` you want specific tax declaration information for. 24 year_from (str, optional): The starting year you want to get tax declaration for, in `YYYY` format. 25 year_to (str, optional): The year you want to stop geting tax declaration for, in `YYYY` format. 26 attach_pdf (bool, optional): When this is set to `True`, you will receive the PDF as a binary string in the response. Defaults to `False`. 27 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 28 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 29 30 Returns: 31 Dict: The details of the object. For more information on the response from the API, see our [Tax declarations API documentation](https://developers.belvo.com/reference/retrievetaxdeclarations). 32 """ 33 34 data = { 35 "link": link, 36 "year_from": year_from, 37 "year_to": year_to, 38 "attach_pdf": attach_pdf, 39 "save_data": save_data, 40 } 41 42 return self.session.post( 43 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 44 )
7class TaxDeclarations(Resource): 8 endpoint = "/api/tax-declarations/" 9 10 def create( 11 self, 12 link: str, 13 year_from: str, 14 year_to: str, 15 *, 16 attach_pdf: bool = False, 17 save_data: bool = True, 18 raise_exception: bool = False, 19 **kwargs: Dict, 20 ) -> Union[List[Dict], Dict]: 21 """Retrieve tax declaration for a link 22 23 Args: 24 link (str): The fiscal `link.id` you want specific tax declaration information for. 25 year_from (str, optional): The starting year you want to get tax declaration for, in `YYYY` format. 26 year_to (str, optional): The year you want to stop geting tax declaration for, in `YYYY` format. 27 attach_pdf (bool, optional): When this is set to `True`, you will receive the PDF as a binary string in the response. Defaults to `False`. 28 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 29 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 30 31 Returns: 32 Dict: The details of the object. For more information on the response from the API, see our [Tax declarations API documentation](https://developers.belvo.com/reference/retrievetaxdeclarations). 33 """ 34 35 data = { 36 "link": link, 37 "year_from": year_from, 38 "year_to": year_to, 39 "attach_pdf": attach_pdf, 40 "save_data": save_data, 41 } 42 43 return self.session.post( 44 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 45 )
def
create( self, link: str, year_from: str, year_to: str, *, attach_pdf: bool = False, save_data: bool = True, raise_exception: bool = False, **kwargs: Dict) -> Union[List[Dict], Dict]:
10 def create( 11 self, 12 link: str, 13 year_from: str, 14 year_to: str, 15 *, 16 attach_pdf: bool = False, 17 save_data: bool = True, 18 raise_exception: bool = False, 19 **kwargs: Dict, 20 ) -> Union[List[Dict], Dict]: 21 """Retrieve tax declaration for a link 22 23 Args: 24 link (str): The fiscal `link.id` you want specific tax declaration information for. 25 year_from (str, optional): The starting year you want to get tax declaration for, in `YYYY` format. 26 year_to (str, optional): The year you want to stop geting tax declaration for, in `YYYY` format. 27 attach_pdf (bool, optional): When this is set to `True`, you will receive the PDF as a binary string in the response. Defaults to `False`. 28 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 29 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 30 31 Returns: 32 Dict: The details of the object. For more information on the response from the API, see our [Tax declarations API documentation](https://developers.belvo.com/reference/retrievetaxdeclarations). 33 """ 34 35 data = { 36 "link": link, 37 "year_from": year_from, 38 "year_to": year_to, 39 "attach_pdf": attach_pdf, 40 "save_data": save_data, 41 } 42 43 return self.session.post( 44 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 45 )
Retrieve tax declaration for a link
Arguments:
- link (str): The fiscal
link.id
you want specific tax declaration information for. - year_from (str, optional): The starting year you want to get tax declaration for, in
YYYY
format. - year_to (str, optional): The year you want to stop geting tax declaration for, in
YYYY
format. - attach_pdf (bool, optional): When this is set to
True
, you will receive the PDF as a binary string in the response. Defaults toFalse
. - save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to
True
. - raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to
False
.
Returns:
Dict: The details of the object. For more information on the response from the API, see our Tax declarations API documentation.