belvo.resources.tax_compliance_status

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

Retrieve a tax compliance status for a link

Example:

# Fetch tax compliance status for a Link
tax_compliance_status = client.TaxComplianceStatus.create(
    "b91835f5-6f83-4d9b-a0ad-a5a249f18b7c"
)

# Fetch tax compliance status for a Link and retrieve its pdf
tax_compliance_status = client.TaxComplianceStatus.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 compliance status API documentation.

def resume( self, session: str, token: str, *, link: str = None, raise_exception: bool = False, **kwargs: Dict) -> Dict:
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()

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.