belvo.resources.tax_status

 1from typing import Dict, List, Union
 2
 3from belvo.resources.base import Resource
 4
 5
 6class TaxStatus(Resource):
 7    endpoint = "/api/tax-status/"
 8
 9    def create(
10        self,
11        link: str,
12        *,
13        attach_pdf: bool = False,
14        save_data: bool = True,
15        raise_exception: bool = False,
16        **kwargs: Dict,
17    ) -> Union[List[Dict], Dict]:
18        """Retrieve the tax status for a link
19
20        Example:
21            ```python
22            # Fetch the tax status for a Link
23            tax_status = client.TaxStatus.create(
24                "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c"
25            )
26
27            # Fetch the tax status for a Link and retrieve its pdf
28            tax_status = client.TaxReturns.create(
29                "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c",
30                attach_pdf=True
31            )
32
33            ```
34
35        Args:
36            link (str): The fiscal `link.id` that you want to get information for (UUID).
37            attach_pdf (bool, optional): When set to `True`, you will receive the PDF in binary format in the response. Defaults to `False`.
38            save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`.
39            raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`.
40
41        Returns:
42            Dict: The details of the object. For more information on the response from the API, see our [Tax status API documentation](https://developers.belvo.com/reference/retrievetaxstatus).
43        """
44
45        data = {"link": link, "attach_pdf": attach_pdf, "save_data": save_data}
46
47        return self.session.post(
48            self.endpoint, data=data, raise_exception=raise_exception, **kwargs
49        )
50
51    def resume(
52        self,
53        session: str,
54        token: str,
55        *,
56        link: str = None,
57        raise_exception: bool = False,
58        **kwargs: Dict,
59    ) -> Dict:
60        raise NotImplementedError()
class TaxStatus(belvo.resources.base.Resource):
 7class TaxStatus(Resource):
 8    endpoint = "/api/tax-status/"
 9
10    def create(
11        self,
12        link: str,
13        *,
14        attach_pdf: bool = False,
15        save_data: bool = True,
16        raise_exception: bool = False,
17        **kwargs: Dict,
18    ) -> Union[List[Dict], Dict]:
19        """Retrieve the tax status for a link
20
21        Example:
22            ```python
23            # Fetch the tax status for a Link
24            tax_status = client.TaxStatus.create(
25                "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c"
26            )
27
28            # Fetch the tax status for a Link and retrieve its pdf
29            tax_status = client.TaxReturns.create(
30                "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c",
31                attach_pdf=True
32            )
33
34            ```
35
36        Args:
37            link (str): The fiscal `link.id` that you want to get information for (UUID).
38            attach_pdf (bool, optional): When set to `True`, you will receive the PDF in binary format in the response. Defaults to `False`.
39            save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`.
40            raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`.
41
42        Returns:
43            Dict: The details of the object. For more information on the response from the API, see our [Tax status API documentation](https://developers.belvo.com/reference/retrievetaxstatus).
44        """
45
46        data = {"link": link, "attach_pdf": attach_pdf, "save_data": save_data}
47
48        return self.session.post(
49            self.endpoint, data=data, raise_exception=raise_exception, **kwargs
50        )
51
52    def resume(
53        self,
54        session: str,
55        token: str,
56        *,
57        link: str = None,
58        raise_exception: bool = False,
59        **kwargs: Dict,
60    ) -> Dict:
61        raise NotImplementedError()
endpoint = '/api/tax-status/'
def create( self, link: 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        *,
14        attach_pdf: bool = False,
15        save_data: bool = True,
16        raise_exception: bool = False,
17        **kwargs: Dict,
18    ) -> Union[List[Dict], Dict]:
19        """Retrieve the tax status for a link
20
21        Example:
22            ```python
23            # Fetch the tax status for a Link
24            tax_status = client.TaxStatus.create(
25                "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c"
26            )
27
28            # Fetch the tax status for a Link and retrieve its pdf
29            tax_status = client.TaxReturns.create(
30                "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c",
31                attach_pdf=True
32            )
33
34            ```
35
36        Args:
37            link (str): The fiscal `link.id` that you want to get information for (UUID).
38            attach_pdf (bool, optional): When set to `True`, you will receive the PDF in binary format in the response. Defaults to `False`.
39            save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`.
40            raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`.
41
42        Returns:
43            Dict: The details of the object. For more information on the response from the API, see our [Tax status API documentation](https://developers.belvo.com/reference/retrievetaxstatus).
44        """
45
46        data = {"link": link, "attach_pdf": attach_pdf, "save_data": save_data}
47
48        return self.session.post(
49            self.endpoint, data=data, raise_exception=raise_exception, **kwargs
50        )

Retrieve the tax status for a link

Example:
# Fetch the tax status for a Link
tax_status = client.TaxStatus.create(
    "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c"
)

# Fetch the tax status for a Link and retrieve its pdf
tax_status = client.TaxReturns.create(
    "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c",
    attach_pdf=True
)
Arguments:
  • link (str): The fiscal link.id that you want to get information for (UUID).
  • attach_pdf (bool, optional): When set to True, you will receive the PDF in binary format in the response. Defaults to False.
  • 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 status API documentation.

def resume( self, session: str, token: str, *, link: str = None, raise_exception: bool = False, **kwargs: Dict) -> Dict:
52    def resume(
53        self,
54        session: str,
55        token: str,
56        *,
57        link: str = None,
58        raise_exception: bool = False,
59        **kwargs: Dict,
60    ) -> Dict:
61        raise NotImplementedError()

Resume a resource sessions

Example:

# Login to Belvo API
client = Client("Secret Key ID", "Secret Key PASSWORD", "sandbox")

# Resume a link
link = client.Links.resume(
  session="session_id",
  token="token",
  link="link_id"
)

Arguments:
  • session (str): The session you want to resume (UUID).
  • token (str): The MFA token required to continue the session.
  • link (str, optional): The Link ID . Defaults to None.
  • raise_exception (bool, optional): Boolean indicating whether to return an API error or to raise an exception. Defaults to False.
Returns:

Union[List[Dict], Dict]: On success, returns the resource data requests.