Skip to main content

eCF-Pronesoft Integration API

Project description

pronesoft-ecf

Descripción general

API de nivel productivo para emitir Comprobantes Fiscales Electrónicos (e-CF) en la República Dominicana a través de la plataforma Pronesoft.

Autenticación — OAuth 2.0 Client Credentials

Pasos

  1. Obtén tus credenciales desde el portal:
  2. Solicita un token via POST /oauth/token — válido por 24 horas (86400s).
  3. Usa: Authorization: Bearer en cada request.
  4. Renueva al recibir HTTP 401. Buena práctica: renovar 5 minutos antes del vencimiento.

Delegación multi-empresa

Para actuar en nombre de una empresa asociada (sucursal), agrega: x-tenant-id: NO envíes x-tenant-id cuando actúes como la empresa principal.

Detalles del Sandbox

  • Usa cualquier RNC que comience con SBX (ej. SBX123456) — no se requiere certificado real.
  • Las secuencias son automáticas — no es necesario crearlas manualmente.
  • El campo environment en el cuerpo del documento DEBE ser TesteCF.

Scopes disponibles

business:read, business:create, business:update, members:read, members:invite, members:revoke, certificates:read, certificates:upload, certificates:update, documents:read, documents:create, documents:send, documents:receive, documents:update, approvals:read, approvals:commercial, sequences:read, sequences:create, sequences:update, sequences:cancel, business_info:read, certification:read, certification:write, reports:read

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.2.0
  • Package version: 0.0.3
  • Generator version: 7.21.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://pronesoft.com

Requirements.

Python 3.9+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/ProneSoftSRL/pronesoft-ecf-sdks.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/ProneSoftSRL/pronesoft-ecf-sdks.git)

Then import the package:

import pronesoft_ecf

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pronesoft_ecf

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import pronesoft_ecf
from pronesoft_ecf.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.ecf.sandbox.pronesoft.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pronesoft_ecf.Configuration(
    host = "https://api.ecf.sandbox.pronesoft.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]


# Enter a context with an instance of the API client
with pronesoft_ecf.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pronesoft_ecf.AssociatedCompaniesApi(api_client)
    email = 'email_example' # str | 
    password = 'password_example' # str | 
    name = 'name_example' # str | 
    rnc = 'rnc_example' # str | 
    phone = 'phone_example' # str | 
    address = 'address_example' # str | 
    city = 'city_example' # str | 
    country = 'country_example' # str | 
    printer_type = pronesoft_ecf.PrintFormat() # PrintFormat | 
    first_name = 'first_name_example' # str |  (optional)
    last_name = 'last_name_example' # str |  (optional)
    job_title = 'job_title_example' # str |  (optional)
    website = 'website_example' # str |  (optional)
    category = 'category_example' # str |  (optional)
    monthly_sales_range = 'monthly_sales_range_example' # str |  (optional)
    logo = None # bytes |  (optional)

    try:
        # Crear empresa asociada / sucursal
        api_response = api_instance.create_associated_company(email, password, name, rnc, phone, address, city, country, printer_type, first_name=first_name, last_name=last_name, job_title=job_title, website=website, category=category, monthly_sales_range=monthly_sales_range, logo=logo)
        print("The response of AssociatedCompaniesApi->create_associated_company:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AssociatedCompaniesApi->create_associated_company: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.ecf.sandbox.pronesoft.com/api/v1

Class Method HTTP request Description
AssociatedCompaniesApi create_associated_company POST /associated-companies Crear empresa asociada / sucursal
AssociatedCompaniesApi delete_associated_company DELETE /associated-companies/{companyId} Eliminar empresa asociada
AssociatedCompaniesApi get_company_document_metrics GET /associated-companies/{companyId}/documents-metrics Métricas de documentos de la empresa
AssociatedCompaniesApi get_company_metrics GET /associated-companies/{companyId}/metrics Métricas de la empresa
AssociatedCompaniesApi list_associated_companies GET /associated-companies Listar empresas asociadas / sucursales
AssociatedCompaniesApi update_associated_company PUT /associated-companies/{companyId} Actualizar empresa asociada
AuthenticationApi get_access_token POST /oauth/token Obtener token de acceso (OAuth 2.0)
AutomatedCertificationApi download_certification GET /dgii-ecf/automated-certification/{id}/download Descargar ZIP de certificación
AutomatedCertificationApi get_certification_status GET /dgii-ecf/automated-certification/{id}/status Estado del proceso de certificación
AutomatedCertificationApi list_certification_niches GET /dgii-ecf/automated-certification/niches Listar nichos de certificación
AutomatedCertificationApi start_certification POST /dgii-ecf/automated-certification/start Iniciar proceso de certificación
CommercialApprovalsApi get_commercial_approval_by_id GET /documents/approvals/{id} Obtener aprobación comercial por ID
CommercialApprovalsApi list_commercial_approvals GET /documents/approvals Listar aprobaciones comerciales
DigitalCertificatesApi upload_certificate POST /{rnc}/certificates Subir certificado digital (P12/PFX)
DocumentsReceivedApi get_received_document_by_id GET /documents/received/{id} Obtener documento recibido por ID
DocumentsReceivedApi get_received_document_stats_by_supplier GET /documents/received/stats/by-supplier Top 10 proveedores por volumen de documentos recibidos
DocumentsReceivedApi get_received_document_stats_summary GET /documents/received/stats/summary Estadísticas de documentos recibidos
DocumentsReceivedApi list_received_documents GET /documents/received Listar documentos recibidos
DocumentsSentApi download_sent_document_xml GET /documents/download Descargar XML del documento
DocumentsSentApi get_sent_document_by_id GET /documents/{id} Obtener detalle del documento
DocumentsSentApi get_sent_document_logs GET /documents/logs/{id} Logs de procesamiento del documento
DocumentsSentApi get_sent_document_stats GET /documents/stats/summary Estadísticas de documentos enviados
DocumentsSentApi get_sent_document_stats_by_environment GET /documents/stats/by-environment Estadísticas agrupadas por ambiente y estado
DocumentsSentApi get_sent_document_status_options GET /documents/status-options Opciones de filtro de estado disponibles
DocumentsSentApi list_sent_documents GET /documents/sent Listar documentos enviados
ReportsApi export606 GET /dgii/606/export Exportar Formato 606 (Compras)
ReportsApi export_sent_documents GET /dgii/sent/export Exportar reporte de documentos enviados
TaxSequencesApi create_tax_sequence POST /tax-sequences/create Crear nueva secuencia de NCF
TaxSequencesApi get_next_number GET /tax-sequences/next Obtener siguiente número fiscal disponible
TaxSequencesApi list_tax_sequences GET /tax-sequences Listar secuencias de NCF
TaxSequencesApi update_tax_sequence PATCH /tax-sequences/update Actualizar secuencia de NCF
TaxSequencesApi void_tax_sequence POST /tax-sequences/void Anular rango de números fiscales
WebhookConfigurationApi get_webhook GET /{rnc}/webhooks/{webhookId} Detalle de un webhook
WebhookConfigurationApi get_webhook_stats GET /{rnc}/webhooks/{webhookId}/stats Estadísticas de entregas del webhook
WebhookConfigurationApi list_webhooks GET /{rnc}/webhooks Listar configuraciones de webhooks
ECFSubmissionApi get_ecf_stats GET /{environment}/ecf/responses/stats Obtener estadísticas de envíos (últimos 30 días)
ECFSubmissionApi get_ecf_status GET /{environment}/ecf/status/{id} Consultar estado del documento por ID interno
ECFSubmissionApi get_ecf_submission_history GET /{environment}/ecf/responses/history Historial de envíos (paginado)
ECFSubmissionApi submit_ecf POST /{environment}/ecf/submit Enviar documento e-CF a la DGII

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (JWT)

oauth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • business:read: Consultar datos de la empresa.
  • business:create: Crear una nueva empresa.
  • business:update: Actualizar datos de la empresa.
  • members:read: Ver miembros del equipo.
  • members:invite: Invitar nuevos miembros.
  • members:revoke: Revocar acceso de miembros.
  • certificates:read: Ver certificados digitales.
  • certificates:upload: Subir nuevos certificados.
  • certificates:update: Actualizar certificados existentes.
  • documents:read: Listar y consultar detalles de documentos.
  • documents:create: Crear borradores o documentos internos.
  • documents:send: Enviar e-CF a la DGII.
  • documents:receive: Recibir e-CF de terceros.
  • documents:update: Modificar metadatos de documentos.
  • approvals:read: Ver estados de aprobación.
  • approvals:commercial: Realizar aprobaciones o rechazos comerciales.
  • sequences:read: Ver rangos de NCF/e-NCF.
  • sequences:create: Solicitar o agregar nuevas secuencias.
  • sequences:update: Modificar configuraciones de secuencias.
  • sequences:cancel: Cancelar secuencias no utilizadas.
  • business_info:read: Acceder a estadísticas y métricas del dashboard.
  • certification:read: Ver progreso de certificación DGII.
  • certification:write: Ejecutar pruebas de certificación automática DGII.
  • reports:read: Generar y exportar reportes (ej. formato 606).

Author

support@pronesoft.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pronesoft_ecf-0.0.3.tar.gz (141.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pronesoft_ecf-0.0.3-py3-none-any.whl (359.1 kB view details)

Uploaded Python 3

File details

Details for the file pronesoft_ecf-0.0.3.tar.gz.

File metadata

  • Download URL: pronesoft_ecf-0.0.3.tar.gz
  • Upload date:
  • Size: 141.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pronesoft_ecf-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8208065b428e067ad7597b7b6438d41c4b36f88cadf2edce7fec3993dd5b61fb
MD5 362a1612ff4ee628d5aadd630bc1c8de
BLAKE2b-256 33d0f818593f04ba650b3931ccb7c8f61a04a9f5385890729ccd23179f9c6717

See more details on using hashes here.

File details

Details for the file pronesoft_ecf-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pronesoft_ecf-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 359.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pronesoft_ecf-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 37c85401d3d4cd3df99b63a5e05a5f606f0e51880ac18163a14596cef86d06a2
MD5 db0eaefde2433e95859fff209ac4271f
BLAKE2b-256 cb4ad38caddf5d5852c67b8367841bb14d1d7420e7407663651e708805ca14dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page