@pronesoft-rd/ecf-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +96 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +234 -0
- package/dist/apis/AssociatedCompaniesApi.d.ts +150 -0
- package/dist/apis/AssociatedCompaniesApi.js +229 -0
- package/dist/apis/AuthenticationApi.d.ts +64 -0
- package/dist/apis/AuthenticationApi.js +75 -0
- package/dist/apis/DigitalCertificatesApi.d.ts +70 -0
- package/dist/apis/DigitalCertificatesApi.js +113 -0
- package/dist/apis/ECFSubmissionApi.d.ts +70 -0
- package/dist/apis/ECFSubmissionApi.js +96 -0
- package/dist/apis/TaxSequencesApi.d.ts +152 -0
- package/dist/apis/TaxSequencesApi.js +214 -0
- package/dist/apis/WebhookConfigurationApi.d.ts +146 -0
- package/dist/apis/WebhookConfigurationApi.js +197 -0
- package/dist/apis/index.d.ts +6 -0
- package/dist/apis/index.js +24 -0
- package/dist/esm/apis/AssociatedCompaniesApi.d.ts +150 -0
- package/dist/esm/apis/AssociatedCompaniesApi.js +225 -0
- package/dist/esm/apis/AuthenticationApi.d.ts +64 -0
- package/dist/esm/apis/AuthenticationApi.js +71 -0
- package/dist/esm/apis/DigitalCertificatesApi.d.ts +70 -0
- package/dist/esm/apis/DigitalCertificatesApi.js +109 -0
- package/dist/esm/apis/ECFSubmissionApi.d.ts +70 -0
- package/dist/esm/apis/ECFSubmissionApi.js +92 -0
- package/dist/esm/apis/TaxSequencesApi.d.ts +152 -0
- package/dist/esm/apis/TaxSequencesApi.js +210 -0
- package/dist/esm/apis/WebhookConfigurationApi.d.ts +146 -0
- package/dist/esm/apis/WebhookConfigurationApi.js +193 -0
- package/dist/esm/apis/index.d.ts +6 -0
- package/dist/esm/apis/index.js +8 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/AccountType.d.ts +30 -0
- package/dist/esm/models/AccountType.js +48 -0
- package/dist/esm/models/AdditionalInfo.d.ts +50 -0
- package/dist/esm/models/AdditionalInfo.js +47 -0
- package/dist/esm/models/AlternativeCurrency.d.ts +46 -0
- package/dist/esm/models/AlternativeCurrency.js +49 -0
- package/dist/esm/models/AssociatedCompany.d.ts +125 -0
- package/dist/esm/models/AssociatedCompany.js +77 -0
- package/dist/esm/models/AssociatedCompanySubscription.d.ts +45 -0
- package/dist/esm/models/AssociatedCompanySubscription.js +46 -0
- package/dist/esm/models/AssociatedCompanySubscriptionPlan.d.ts +38 -0
- package/dist/esm/models/AssociatedCompanySubscriptionPlan.js +43 -0
- package/dist/esm/models/BillingIndicator.d.ts +34 -0
- package/dist/esm/models/BillingIndicator.js +52 -0
- package/dist/esm/models/Buyer.d.ts +68 -0
- package/dist/esm/models/Buyer.js +55 -0
- package/dist/esm/models/CreateAssociatedCompany201Response.d.ts +39 -0
- package/dist/esm/models/CreateAssociatedCompany201Response.js +44 -0
- package/dist/esm/models/CreateTaxSequenceRequest.d.ts +47 -0
- package/dist/esm/models/CreateTaxSequenceRequest.js +52 -0
- package/dist/esm/models/CreateWebhookConfig.d.ts +53 -0
- package/dist/esm/models/CreateWebhookConfig.js +52 -0
- package/dist/esm/models/DiscountOrSurcharge.d.ts +93 -0
- package/dist/esm/models/DiscountOrSurcharge.js +78 -0
- package/dist/esm/models/EcfSubmissionResponse.d.ts +56 -0
- package/dist/esm/models/EcfSubmissionResponse.js +53 -0
- package/dist/esm/models/ElectronicDocument.d.ts +252 -0
- package/dist/esm/models/ElectronicDocument.js +143 -0
- package/dist/esm/models/Environment.d.ts +30 -0
- package/dist/esm/models/Environment.js +48 -0
- package/dist/esm/models/ErrorResponse.d.ts +44 -0
- package/dist/esm/models/ErrorResponse.js +45 -0
- package/dist/esm/models/GetNextNumber200Response.d.ts +39 -0
- package/dist/esm/models/GetNextNumber200Response.js +44 -0
- package/dist/esm/models/GetNextNumber200ResponseData.d.ts +38 -0
- package/dist/esm/models/GetNextNumber200ResponseData.js +43 -0
- package/dist/esm/models/InvoiceType.d.ts +44 -0
- package/dist/esm/models/InvoiceType.js +62 -0
- package/dist/esm/models/Item.d.ts +106 -0
- package/dist/esm/models/Item.js +83 -0
- package/dist/esm/models/ItemAdditionalTax.d.ts +38 -0
- package/dist/esm/models/ItemAdditionalTax.js +47 -0
- package/dist/esm/models/ListTaxSequences200Response.d.ts +39 -0
- package/dist/esm/models/ListTaxSequences200Response.js +44 -0
- package/dist/esm/models/OAuthTokenRequest.d.ts +43 -0
- package/dist/esm/models/OAuthTokenRequest.js +47 -0
- package/dist/esm/models/OAuthTokenResponse.d.ts +46 -0
- package/dist/esm/models/OAuthTokenResponse.js +45 -0
- package/dist/esm/models/Page.d.ts +116 -0
- package/dist/esm/models/Page.js +75 -0
- package/dist/esm/models/PaymentMethod.d.ts +40 -0
- package/dist/esm/models/PaymentMethod.js +58 -0
- package/dist/esm/models/PrintFormat.d.ts +30 -0
- package/dist/esm/models/PrintFormat.js +48 -0
- package/dist/esm/models/ReferenceInfo.d.ts +76 -0
- package/dist/esm/models/ReferenceInfo.js +63 -0
- package/dist/esm/models/Subquantity.d.ts +38 -0
- package/dist/esm/models/Subquantity.js +47 -0
- package/dist/esm/models/Subtotal.d.ts +110 -0
- package/dist/esm/models/Subtotal.js +71 -0
- package/dist/esm/models/TaxSequence.d.ts +45 -0
- package/dist/esm/models/TaxSequence.js +46 -0
- package/dist/esm/models/Totals.d.ts +173 -0
- package/dist/esm/models/Totals.js +90 -0
- package/dist/esm/models/Transport.d.ts +62 -0
- package/dist/esm/models/Transport.js +51 -0
- package/dist/esm/models/UploadCertificate201Response.d.ts +44 -0
- package/dist/esm/models/UploadCertificate201Response.js +45 -0
- package/dist/esm/models/UploadCertificateResponse.d.ts +44 -0
- package/dist/esm/models/UploadCertificateResponse.js +45 -0
- package/dist/esm/models/WebhookConfigResponse.d.ts +63 -0
- package/dist/esm/models/WebhookConfigResponse.js +52 -0
- package/dist/esm/models/WebhookEventType.d.ts +40 -0
- package/dist/esm/models/WebhookEventType.js +58 -0
- package/dist/esm/models/WebhookNotificationPayload.d.ts +59 -0
- package/dist/esm/models/WebhookNotificationPayload.js +60 -0
- package/dist/esm/models/index.d.ts +37 -0
- package/dist/esm/models/index.js +39 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +349 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/AccountType.d.ts +30 -0
- package/dist/models/AccountType.js +56 -0
- package/dist/models/AdditionalInfo.d.ts +50 -0
- package/dist/models/AdditionalInfo.js +54 -0
- package/dist/models/AlternativeCurrency.d.ts +46 -0
- package/dist/models/AlternativeCurrency.js +56 -0
- package/dist/models/AssociatedCompany.d.ts +125 -0
- package/dist/models/AssociatedCompany.js +85 -0
- package/dist/models/AssociatedCompanySubscription.d.ts +45 -0
- package/dist/models/AssociatedCompanySubscription.js +53 -0
- package/dist/models/AssociatedCompanySubscriptionPlan.d.ts +38 -0
- package/dist/models/AssociatedCompanySubscriptionPlan.js +50 -0
- package/dist/models/BillingIndicator.d.ts +34 -0
- package/dist/models/BillingIndicator.js +60 -0
- package/dist/models/Buyer.d.ts +68 -0
- package/dist/models/Buyer.js +62 -0
- package/dist/models/CreateAssociatedCompany201Response.d.ts +39 -0
- package/dist/models/CreateAssociatedCompany201Response.js +51 -0
- package/dist/models/CreateTaxSequenceRequest.d.ts +47 -0
- package/dist/models/CreateTaxSequenceRequest.js +59 -0
- package/dist/models/CreateWebhookConfig.d.ts +53 -0
- package/dist/models/CreateWebhookConfig.js +59 -0
- package/dist/models/DiscountOrSurcharge.d.ts +93 -0
- package/dist/models/DiscountOrSurcharge.js +86 -0
- package/dist/models/EcfSubmissionResponse.d.ts +56 -0
- package/dist/models/EcfSubmissionResponse.js +60 -0
- package/dist/models/ElectronicDocument.d.ts +252 -0
- package/dist/models/ElectronicDocument.js +151 -0
- package/dist/models/Environment.d.ts +30 -0
- package/dist/models/Environment.js +56 -0
- package/dist/models/ErrorResponse.d.ts +44 -0
- package/dist/models/ErrorResponse.js +52 -0
- package/dist/models/GetNextNumber200Response.d.ts +39 -0
- package/dist/models/GetNextNumber200Response.js +51 -0
- package/dist/models/GetNextNumber200ResponseData.d.ts +38 -0
- package/dist/models/GetNextNumber200ResponseData.js +50 -0
- package/dist/models/InvoiceType.d.ts +44 -0
- package/dist/models/InvoiceType.js +70 -0
- package/dist/models/Item.d.ts +106 -0
- package/dist/models/Item.js +91 -0
- package/dist/models/ItemAdditionalTax.d.ts +38 -0
- package/dist/models/ItemAdditionalTax.js +54 -0
- package/dist/models/ListTaxSequences200Response.d.ts +39 -0
- package/dist/models/ListTaxSequences200Response.js +51 -0
- package/dist/models/OAuthTokenRequest.d.ts +43 -0
- package/dist/models/OAuthTokenRequest.js +54 -0
- package/dist/models/OAuthTokenResponse.d.ts +46 -0
- package/dist/models/OAuthTokenResponse.js +52 -0
- package/dist/models/Page.d.ts +116 -0
- package/dist/models/Page.js +82 -0
- package/dist/models/PaymentMethod.d.ts +40 -0
- package/dist/models/PaymentMethod.js +66 -0
- package/dist/models/PrintFormat.d.ts +30 -0
- package/dist/models/PrintFormat.js +56 -0
- package/dist/models/ReferenceInfo.d.ts +76 -0
- package/dist/models/ReferenceInfo.js +71 -0
- package/dist/models/Subquantity.d.ts +38 -0
- package/dist/models/Subquantity.js +54 -0
- package/dist/models/Subtotal.d.ts +110 -0
- package/dist/models/Subtotal.js +78 -0
- package/dist/models/TaxSequence.d.ts +45 -0
- package/dist/models/TaxSequence.js +53 -0
- package/dist/models/Totals.d.ts +173 -0
- package/dist/models/Totals.js +97 -0
- package/dist/models/Transport.d.ts +62 -0
- package/dist/models/Transport.js +58 -0
- package/dist/models/UploadCertificate201Response.d.ts +44 -0
- package/dist/models/UploadCertificate201Response.js +52 -0
- package/dist/models/UploadCertificateResponse.d.ts +44 -0
- package/dist/models/UploadCertificateResponse.js +52 -0
- package/dist/models/WebhookConfigResponse.d.ts +63 -0
- package/dist/models/WebhookConfigResponse.js +59 -0
- package/dist/models/WebhookEventType.d.ts +40 -0
- package/dist/models/WebhookEventType.js +66 -0
- package/dist/models/WebhookNotificationPayload.d.ts +59 -0
- package/dist/models/WebhookNotificationPayload.js +67 -0
- package/dist/models/index.d.ts +37 -0
- package/dist/models/index.js +55 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +365 -0
- package/docs/AccountType.md +33 -0
- package/docs/AdditionalInfo.md +41 -0
- package/docs/AlternativeCurrency.md +39 -0
- package/docs/AssociatedCompaniesApi.md +207 -0
- package/docs/AssociatedCompany.md +63 -0
- package/docs/AssociatedCompanySubscription.md +38 -0
- package/docs/AssociatedCompanySubscriptionPlan.md +36 -0
- package/docs/AuthenticationApi.md +77 -0
- package/docs/BillingIndicator.md +33 -0
- package/docs/Buyer.md +47 -0
- package/docs/CreateAssociatedCompany201Response.md +36 -0
- package/docs/CreateTaxSequenceRequest.md +39 -0
- package/docs/CreateWebhookConfig.md +41 -0
- package/docs/DigitalCertificatesApi.md +90 -0
- package/docs/DiscountOrSurcharge.md +49 -0
- package/docs/ECFSubmissionApi.md +90 -0
- package/docs/EcfSubmissionResponse.md +43 -0
- package/docs/ElectronicDocument.md +87 -0
- package/docs/Environment.md +33 -0
- package/docs/ErrorResponse.md +39 -0
- package/docs/GetNextNumber200Response.md +36 -0
- package/docs/GetNextNumber200ResponseData.md +36 -0
- package/docs/InvoiceType.md +33 -0
- package/docs/Item.md +55 -0
- package/docs/ItemAdditionalTax.md +37 -0
- package/docs/ListTaxSequences200Response.md +36 -0
- package/docs/OAuthTokenRequest.md +37 -0
- package/docs/OAuthTokenResponse.md +39 -0
- package/docs/Page.md +63 -0
- package/docs/PaymentMethod.md +33 -0
- package/docs/PrintFormat.md +33 -0
- package/docs/ReferenceInfo.md +43 -0
- package/docs/Subquantity.md +37 -0
- package/docs/Subtotal.md +61 -0
- package/docs/TaxSequence.md +39 -0
- package/docs/TaxSequencesApi.md +246 -0
- package/docs/Totals.md +81 -0
- package/docs/Transport.md +45 -0
- package/docs/UploadCertificate201Response.md +38 -0
- package/docs/UploadCertificateResponse.md +39 -0
- package/docs/WebhookConfigResponse.md +45 -0
- package/docs/WebhookConfigurationApi.md +241 -0
- package/docs/WebhookEventType.md +33 -0
- package/docs/WebhookNotificationPayload.md +43 -0
- package/package.json +21 -0
- package/src/apis/AssociatedCompaniesApi.ts +415 -0
- package/src/apis/AuthenticationApi.ts +122 -0
- package/src/apis/DigitalCertificatesApi.ts +175 -0
- package/src/apis/ECFSubmissionApi.ts +163 -0
- package/src/apis/TaxSequencesApi.ts +374 -0
- package/src/apis/WebhookConfigurationApi.ts +332 -0
- package/src/apis/index.ts +8 -0
- package/src/index.ts +5 -0
- package/src/models/AccountType.ts +58 -0
- package/src/models/AdditionalInfo.ts +89 -0
- package/src/models/AlternativeCurrency.ts +85 -0
- package/src/models/AssociatedCompany.ts +196 -0
- package/src/models/AssociatedCompanySubscription.ts +89 -0
- package/src/models/AssociatedCompanySubscriptionPlan.ts +73 -0
- package/src/models/BillingIndicator.ts +62 -0
- package/src/models/Buyer.ts +114 -0
- package/src/models/CreateAssociatedCompany201Response.ts +81 -0
- package/src/models/CreateTaxSequenceRequest.ts +96 -0
- package/src/models/CreateWebhookConfig.ts +101 -0
- package/src/models/DiscountOrSurcharge.ts +155 -0
- package/src/models/EcfSubmissionResponse.ts +99 -0
- package/src/models/ElectronicDocument.ts +421 -0
- package/src/models/Environment.ts +58 -0
- package/src/models/ErrorResponse.ts +81 -0
- package/src/models/GetNextNumber200Response.ts +81 -0
- package/src/models/GetNextNumber200ResponseData.ts +73 -0
- package/src/models/InvoiceType.ts +72 -0
- package/src/models/Item.ts +187 -0
- package/src/models/ItemAdditionalTax.ts +75 -0
- package/src/models/ListTaxSequences200Response.ts +81 -0
- package/src/models/OAuthTokenRequest.ts +80 -0
- package/src/models/OAuthTokenResponse.ts +83 -0
- package/src/models/Page.ts +180 -0
- package/src/models/PaymentMethod.ts +68 -0
- package/src/models/PrintFormat.ts +58 -0
- package/src/models/ReferenceInfo.ts +122 -0
- package/src/models/Subquantity.ts +75 -0
- package/src/models/Subtotal.ts +171 -0
- package/src/models/TaxSequence.ts +91 -0
- package/src/models/Totals.ts +260 -0
- package/src/models/Transport.ts +105 -0
- package/src/models/UploadCertificate201Response.ts +81 -0
- package/src/models/UploadCertificateResponse.ts +81 -0
- package/src/models/WebhookConfigResponse.ts +113 -0
- package/src/models/WebhookEventType.ts +68 -0
- package/src/models/WebhookNotificationPayload.ts +114 -0
- package/src/models/index.ts +39 -0
- package/src/runtime.ts +450 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* eCF-Pronesoft Integration API
|
|
3
|
+
* ## Overview Production-grade API for issuing Electronic Tax Receipts (e-CF) in the Dominican Republic through the Pronesoft platform, which handles all communication with the DGII on your behalf. ## Authentication — OAuth 2.0 Client Credentials This API uses the **OAuth 2.0 Client Credentials** flow. There is no user login — authentication is machine-to-machine using a `clientId` and `clientSecret` issued by the Pronesoft portal. ### Step-by-step 1. **Get credentials**: - Sandbox: https://ecf.sandbox.pronesoft.com - Production: https://ecf.pronesoft.com 2. **Request a token** — call `POST /oauth/token` with your credentials. The server returns an `accessToken` valid for `expiresIn` seconds. 3. **Authorize requests** — include the token in every subsequent request: ``` Authorization: Bearer <accessToken> ``` 4. **Identify your tenant** — include your company/branch UUID in every protected request: ``` x-tenant-id: <your-tenant-uuid> ``` 5. **Refresh** — when the token expires, simply call `POST /oauth/token` again. ### Scopes | Category | Scope | Description | |---|---|---| | **Business** | `business:read` | Read company data | | | `business:create` | Create a new company | | | `business:update` | Update company data | | **Members** | `members:read` | View team members | | | `members:invite` | Invite new members | | | `members:revoke` | Revoke member access | | **Certificates** | `certificates:read` | View digital certificates | | | `certificates:upload` | Upload new certificates | | | `certificates:update` | Update existing certificates | | **Documents** | `documents:read` | List and view documents | | | `documents:create` | Create drafts or internal documents | | | `documents:send` | Submit e-CF to DGII | | | `documents:receive` | Receive e-CF from third parties | | | `documents:update` | Modify document metadata | | **Approvals** | `approvals:read` | View approval statuses | | | `approvals:commercial` | Perform commercial approvals/rejections | | **Sequences** | `sequences:read` | View NCF/e-NCF ranges | | | `sequences:create` | Request new sequences | | | `sequences:update` | Modify sequence configurations | | | `sequences:cancel` | Cancel unused sequences | | **Dashboard** | `business_info:read` | Access dashboard stats and metrics | | **Certification** | `certification:read` | View certification progress | | | `certification:write` | Run automated DGII certification tests | | **Reports** | `reports:read` | Generate and export reports (e.g. 606) | ## Environments | Environment | Portal | API Host | Purpose | |---|---|---|---| | Sandbox | https://ecf.sandbox.pronesoft.com | `api.ecf.sandbox.pronesoft.com` | Development & testing | | Production | https://ecf.pronesoft.com | `api.ecf.pronesoft.com` | Live e-CF issuance | ## Invoice Types (e-NCF) | Code | Name | |---|---| | `31` | Tax Credit Invoice (Factura de Crédito Fiscal) | | `32` | Consumer Invoice (Factura de Consumo) | | `33` | Debit Note (Nota de Débito) | | `34` | Credit Note (Nota de Crédito) | | `41` | Purchases (Compras) | | `43` | Minor Expenses (Gastos Menores) | | `44` | Special Regimes (Regímenes Especiales) | | `45` | Governmental (Gubernamentales) | | `46` | Exports (Exportaciones) | | `47` | Overseas Payments (Pagos al Exterior) |
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.1
|
|
6
|
+
* Contact: contacto@pronesoft.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { EcfSubmissionResponse, ElectronicDocument, Environment } from '../models/index';
|
|
14
|
+
export interface SubmitEcfRequest {
|
|
15
|
+
xTenantId: string;
|
|
16
|
+
environment: Environment;
|
|
17
|
+
electronicDocument: ElectronicDocument;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ECFSubmissionApi - interface
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @interface ECFSubmissionApiInterface
|
|
24
|
+
*/
|
|
25
|
+
export interface ECFSubmissionApiInterface {
|
|
26
|
+
/**
|
|
27
|
+
* Creates request options for submitEcf without sending the request
|
|
28
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
29
|
+
* @param {Environment} environment Target submission environment.
|
|
30
|
+
* @param {ElectronicDocument} electronicDocument
|
|
31
|
+
* @throws {RequiredError}
|
|
32
|
+
* @memberof ECFSubmissionApiInterface
|
|
33
|
+
*/
|
|
34
|
+
submitEcfRequestOpts(requestParameters: SubmitEcfRequest): Promise<runtime.RequestOpts>;
|
|
35
|
+
/**
|
|
36
|
+
* Submits an electronic tax document to the DGII via the Pronesoft platform. Pronesoft handles XML signing, DGII authentication, and status polling on your behalf. ### Flow 1. Build the `ElectronicDocument` payload. 2. Call this endpoint with the target `environment` in the path. 3. Receive a `documentId` and `trackId` in the response. 4. Listen for the `document.status_changed` webhook event, or poll the DGII track ID to confirm final approval. ### Path parameter: environment | Value | Description | |---|---| | `TesteCF` | Functional tests (no DGII interaction) | | `CerteCF` | DGII certification environment | | `eCF` | Production — real documents |
|
|
37
|
+
* @summary Submit e-CF document to DGII
|
|
38
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
39
|
+
* @param {Environment} environment Target submission environment.
|
|
40
|
+
* @param {ElectronicDocument} electronicDocument
|
|
41
|
+
* @param {*} [options] Override http request option.
|
|
42
|
+
* @throws {RequiredError}
|
|
43
|
+
* @memberof ECFSubmissionApiInterface
|
|
44
|
+
*/
|
|
45
|
+
submitEcfRaw(requestParameters: SubmitEcfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EcfSubmissionResponse>>;
|
|
46
|
+
/**
|
|
47
|
+
* Submits an electronic tax document to the DGII via the Pronesoft platform. Pronesoft handles XML signing, DGII authentication, and status polling on your behalf. ### Flow 1. Build the `ElectronicDocument` payload. 2. Call this endpoint with the target `environment` in the path. 3. Receive a `documentId` and `trackId` in the response. 4. Listen for the `document.status_changed` webhook event, or poll the DGII track ID to confirm final approval. ### Path parameter: environment | Value | Description | |---|---| | `TesteCF` | Functional tests (no DGII interaction) | | `CerteCF` | DGII certification environment | | `eCF` | Production — real documents |
|
|
48
|
+
* Submit e-CF document to DGII
|
|
49
|
+
*/
|
|
50
|
+
submitEcf(requestParameters: SubmitEcfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EcfSubmissionResponse>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
export declare class ECFSubmissionApi extends runtime.BaseAPI implements ECFSubmissionApiInterface {
|
|
56
|
+
/**
|
|
57
|
+
* Creates request options for submitEcf without sending the request
|
|
58
|
+
*/
|
|
59
|
+
submitEcfRequestOpts(requestParameters: SubmitEcfRequest): Promise<runtime.RequestOpts>;
|
|
60
|
+
/**
|
|
61
|
+
* Submits an electronic tax document to the DGII via the Pronesoft platform. Pronesoft handles XML signing, DGII authentication, and status polling on your behalf. ### Flow 1. Build the `ElectronicDocument` payload. 2. Call this endpoint with the target `environment` in the path. 3. Receive a `documentId` and `trackId` in the response. 4. Listen for the `document.status_changed` webhook event, or poll the DGII track ID to confirm final approval. ### Path parameter: environment | Value | Description | |---|---| | `TesteCF` | Functional tests (no DGII interaction) | | `CerteCF` | DGII certification environment | | `eCF` | Production — real documents |
|
|
62
|
+
* Submit e-CF document to DGII
|
|
63
|
+
*/
|
|
64
|
+
submitEcfRaw(requestParameters: SubmitEcfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EcfSubmissionResponse>>;
|
|
65
|
+
/**
|
|
66
|
+
* Submits an electronic tax document to the DGII via the Pronesoft platform. Pronesoft handles XML signing, DGII authentication, and status polling on your behalf. ### Flow 1. Build the `ElectronicDocument` payload. 2. Call this endpoint with the target `environment` in the path. 3. Receive a `documentId` and `trackId` in the response. 4. Listen for the `document.status_changed` webhook event, or poll the DGII track ID to confirm final approval. ### Path parameter: environment | Value | Description | |---|---| | `TesteCF` | Functional tests (no DGII interaction) | | `CerteCF` | DGII certification environment | | `eCF` | Production — real documents |
|
|
67
|
+
* Submit e-CF document to DGII
|
|
68
|
+
*/
|
|
69
|
+
submitEcf(requestParameters: SubmitEcfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EcfSubmissionResponse>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* eCF-Pronesoft Integration API
|
|
6
|
+
* ## Overview Production-grade API for issuing Electronic Tax Receipts (e-CF) in the Dominican Republic through the Pronesoft platform, which handles all communication with the DGII on your behalf. ## Authentication — OAuth 2.0 Client Credentials This API uses the **OAuth 2.0 Client Credentials** flow. There is no user login — authentication is machine-to-machine using a `clientId` and `clientSecret` issued by the Pronesoft portal. ### Step-by-step 1. **Get credentials**: - Sandbox: https://ecf.sandbox.pronesoft.com - Production: https://ecf.pronesoft.com 2. **Request a token** — call `POST /oauth/token` with your credentials. The server returns an `accessToken` valid for `expiresIn` seconds. 3. **Authorize requests** — include the token in every subsequent request: ``` Authorization: Bearer <accessToken> ``` 4. **Identify your tenant** — include your company/branch UUID in every protected request: ``` x-tenant-id: <your-tenant-uuid> ``` 5. **Refresh** — when the token expires, simply call `POST /oauth/token` again. ### Scopes | Category | Scope | Description | |---|---|---| | **Business** | `business:read` | Read company data | | | `business:create` | Create a new company | | | `business:update` | Update company data | | **Members** | `members:read` | View team members | | | `members:invite` | Invite new members | | | `members:revoke` | Revoke member access | | **Certificates** | `certificates:read` | View digital certificates | | | `certificates:upload` | Upload new certificates | | | `certificates:update` | Update existing certificates | | **Documents** | `documents:read` | List and view documents | | | `documents:create` | Create drafts or internal documents | | | `documents:send` | Submit e-CF to DGII | | | `documents:receive` | Receive e-CF from third parties | | | `documents:update` | Modify document metadata | | **Approvals** | `approvals:read` | View approval statuses | | | `approvals:commercial` | Perform commercial approvals/rejections | | **Sequences** | `sequences:read` | View NCF/e-NCF ranges | | | `sequences:create` | Request new sequences | | | `sequences:update` | Modify sequence configurations | | | `sequences:cancel` | Cancel unused sequences | | **Dashboard** | `business_info:read` | Access dashboard stats and metrics | | **Certification** | `certification:read` | View certification progress | | | `certification:write` | Run automated DGII certification tests | | **Reports** | `reports:read` | Generate and export reports (e.g. 606) | ## Environments | Environment | Portal | API Host | Purpose | |---|---|---|---| | Sandbox | https://ecf.sandbox.pronesoft.com | `api.ecf.sandbox.pronesoft.com` | Development & testing | | Production | https://ecf.pronesoft.com | `api.ecf.pronesoft.com` | Live e-CF issuance | ## Invoice Types (e-NCF) | Code | Name | |---|---| | `31` | Tax Credit Invoice (Factura de Crédito Fiscal) | | `32` | Consumer Invoice (Factura de Consumo) | | `33` | Debit Note (Nota de Débito) | | `34` | Credit Note (Nota de Crédito) | | `41` | Purchases (Compras) | | `43` | Minor Expenses (Gastos Menores) | | `44` | Special Regimes (Regímenes Especiales) | | `45` | Governmental (Gubernamentales) | | `46` | Exports (Exportaciones) | | `47` | Overseas Payments (Pagos al Exterior) |
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
* Contact: contacto@pronesoft.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ECFSubmissionApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class ECFSubmissionApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for submitEcf without sending the request
|
|
34
|
+
*/
|
|
35
|
+
submitEcfRequestOpts(requestParameters) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['xTenantId'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('xTenantId', 'Required parameter "xTenantId" was null or undefined when calling submitEcf().');
|
|
39
|
+
}
|
|
40
|
+
if (requestParameters['environment'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('environment', 'Required parameter "environment" was null or undefined when calling submitEcf().');
|
|
42
|
+
}
|
|
43
|
+
if (requestParameters['electronicDocument'] == null) {
|
|
44
|
+
throw new runtime.RequiredError('electronicDocument', 'Required parameter "electronicDocument" was null or undefined when calling submitEcf().');
|
|
45
|
+
}
|
|
46
|
+
const queryParameters = {};
|
|
47
|
+
const headerParameters = {};
|
|
48
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
49
|
+
if (requestParameters['xTenantId'] != null) {
|
|
50
|
+
headerParameters['x-tenant-id'] = String(requestParameters['xTenantId']);
|
|
51
|
+
}
|
|
52
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
53
|
+
// oauth required
|
|
54
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("oauth2", ["documents:send"]);
|
|
55
|
+
}
|
|
56
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
57
|
+
const token = this.configuration.accessToken;
|
|
58
|
+
const tokenString = yield token("bearerAuth", []);
|
|
59
|
+
if (tokenString) {
|
|
60
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
let urlPath = `/{environment}/ecf/submit`;
|
|
64
|
+
urlPath = urlPath.replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters['environment'])));
|
|
65
|
+
return {
|
|
66
|
+
path: urlPath,
|
|
67
|
+
method: 'POST',
|
|
68
|
+
headers: headerParameters,
|
|
69
|
+
query: queryParameters,
|
|
70
|
+
body: (0, index_1.ElectronicDocumentToJSON)(requestParameters['electronicDocument']),
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Submits an electronic tax document to the DGII via the Pronesoft platform. Pronesoft handles XML signing, DGII authentication, and status polling on your behalf. ### Flow 1. Build the `ElectronicDocument` payload. 2. Call this endpoint with the target `environment` in the path. 3. Receive a `documentId` and `trackId` in the response. 4. Listen for the `document.status_changed` webhook event, or poll the DGII track ID to confirm final approval. ### Path parameter: environment | Value | Description | |---|---| | `TesteCF` | Functional tests (no DGII interaction) | | `CerteCF` | DGII certification environment | | `eCF` | Production — real documents |
|
|
76
|
+
* Submit e-CF document to DGII
|
|
77
|
+
*/
|
|
78
|
+
submitEcfRaw(requestParameters, initOverrides) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const requestOptions = yield this.submitEcfRequestOpts(requestParameters);
|
|
81
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
82
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EcfSubmissionResponseFromJSON)(jsonValue));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Submits an electronic tax document to the DGII via the Pronesoft platform. Pronesoft handles XML signing, DGII authentication, and status polling on your behalf. ### Flow 1. Build the `ElectronicDocument` payload. 2. Call this endpoint with the target `environment` in the path. 3. Receive a `documentId` and `trackId` in the response. 4. Listen for the `document.status_changed` webhook event, or poll the DGII track ID to confirm final approval. ### Path parameter: environment | Value | Description | |---|---| | `TesteCF` | Functional tests (no DGII interaction) | | `CerteCF` | DGII certification environment | | `eCF` | Production — real documents |
|
|
87
|
+
* Submit e-CF document to DGII
|
|
88
|
+
*/
|
|
89
|
+
submitEcf(requestParameters, initOverrides) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const response = yield this.submitEcfRaw(requestParameters, initOverrides);
|
|
92
|
+
return yield response.value();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.ECFSubmissionApi = ECFSubmissionApi;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* eCF-Pronesoft Integration API
|
|
3
|
+
* ## Overview Production-grade API for issuing Electronic Tax Receipts (e-CF) in the Dominican Republic through the Pronesoft platform, which handles all communication with the DGII on your behalf. ## Authentication — OAuth 2.0 Client Credentials This API uses the **OAuth 2.0 Client Credentials** flow. There is no user login — authentication is machine-to-machine using a `clientId` and `clientSecret` issued by the Pronesoft portal. ### Step-by-step 1. **Get credentials**: - Sandbox: https://ecf.sandbox.pronesoft.com - Production: https://ecf.pronesoft.com 2. **Request a token** — call `POST /oauth/token` with your credentials. The server returns an `accessToken` valid for `expiresIn` seconds. 3. **Authorize requests** — include the token in every subsequent request: ``` Authorization: Bearer <accessToken> ``` 4. **Identify your tenant** — include your company/branch UUID in every protected request: ``` x-tenant-id: <your-tenant-uuid> ``` 5. **Refresh** — when the token expires, simply call `POST /oauth/token` again. ### Scopes | Category | Scope | Description | |---|---|---| | **Business** | `business:read` | Read company data | | | `business:create` | Create a new company | | | `business:update` | Update company data | | **Members** | `members:read` | View team members | | | `members:invite` | Invite new members | | | `members:revoke` | Revoke member access | | **Certificates** | `certificates:read` | View digital certificates | | | `certificates:upload` | Upload new certificates | | | `certificates:update` | Update existing certificates | | **Documents** | `documents:read` | List and view documents | | | `documents:create` | Create drafts or internal documents | | | `documents:send` | Submit e-CF to DGII | | | `documents:receive` | Receive e-CF from third parties | | | `documents:update` | Modify document metadata | | **Approvals** | `approvals:read` | View approval statuses | | | `approvals:commercial` | Perform commercial approvals/rejections | | **Sequences** | `sequences:read` | View NCF/e-NCF ranges | | | `sequences:create` | Request new sequences | | | `sequences:update` | Modify sequence configurations | | | `sequences:cancel` | Cancel unused sequences | | **Dashboard** | `business_info:read` | Access dashboard stats and metrics | | **Certification** | `certification:read` | View certification progress | | | `certification:write` | Run automated DGII certification tests | | **Reports** | `reports:read` | Generate and export reports (e.g. 606) | ## Environments | Environment | Portal | API Host | Purpose | |---|---|---|---| | Sandbox | https://ecf.sandbox.pronesoft.com | `api.ecf.sandbox.pronesoft.com` | Development & testing | | Production | https://ecf.pronesoft.com | `api.ecf.pronesoft.com` | Live e-CF issuance | ## Invoice Types (e-NCF) | Code | Name | |---|---| | `31` | Tax Credit Invoice (Factura de Crédito Fiscal) | | `32` | Consumer Invoice (Factura de Consumo) | | `33` | Debit Note (Nota de Débito) | | `34` | Credit Note (Nota de Crédito) | | `41` | Purchases (Compras) | | `43` | Minor Expenses (Gastos Menores) | | `44` | Special Regimes (Regímenes Especiales) | | `45` | Governmental (Gubernamentales) | | `46` | Exports (Exportaciones) | | `47` | Overseas Payments (Pagos al Exterior) |
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.1
|
|
6
|
+
* Contact: contacto@pronesoft.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CreateTaxSequenceRequest, Environment, GetNextNumber200Response, InvoiceType, ListTaxSequences200Response } from '../models/index';
|
|
14
|
+
export interface CreateTaxSequenceOperationRequest {
|
|
15
|
+
xTenantId: string;
|
|
16
|
+
createTaxSequenceRequest: CreateTaxSequenceRequest;
|
|
17
|
+
}
|
|
18
|
+
export interface GetNextNumberRequest {
|
|
19
|
+
xTenantId: string;
|
|
20
|
+
type: InvoiceType;
|
|
21
|
+
environment: Environment;
|
|
22
|
+
}
|
|
23
|
+
export interface ListTaxSequencesRequest {
|
|
24
|
+
xTenantId: string;
|
|
25
|
+
type?: InvoiceType;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* TaxSequencesApi - interface
|
|
29
|
+
*
|
|
30
|
+
* @export
|
|
31
|
+
* @interface TaxSequencesApiInterface
|
|
32
|
+
*/
|
|
33
|
+
export interface TaxSequencesApiInterface {
|
|
34
|
+
/**
|
|
35
|
+
* Creates request options for createTaxSequence without sending the request
|
|
36
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
37
|
+
* @param {CreateTaxSequenceRequest} createTaxSequenceRequest
|
|
38
|
+
* @throws {RequiredError}
|
|
39
|
+
* @memberof TaxSequencesApiInterface
|
|
40
|
+
*/
|
|
41
|
+
createTaxSequenceRequestOpts(requestParameters: CreateTaxSequenceOperationRequest): Promise<runtime.RequestOpts>;
|
|
42
|
+
/**
|
|
43
|
+
* Registers a new block of fiscal numbers for a given invoice type. The `from` and `to` values define the numeric range of the sequence.
|
|
44
|
+
* @summary Create new tax sequence
|
|
45
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
46
|
+
* @param {CreateTaxSequenceRequest} createTaxSequenceRequest
|
|
47
|
+
* @param {*} [options] Override http request option.
|
|
48
|
+
* @throws {RequiredError}
|
|
49
|
+
* @memberof TaxSequencesApiInterface
|
|
50
|
+
*/
|
|
51
|
+
createTaxSequenceRaw(requestParameters: CreateTaxSequenceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
52
|
+
/**
|
|
53
|
+
* Registers a new block of fiscal numbers for a given invoice type. The `from` and `to` values define the numeric range of the sequence.
|
|
54
|
+
* Create new tax sequence
|
|
55
|
+
*/
|
|
56
|
+
createTaxSequence(requestParameters: CreateTaxSequenceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Creates request options for getNextNumber without sending the request
|
|
59
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
60
|
+
* @param {InvoiceType} type Invoice type code (e.g. \"31\" for Tax Credit Invoice).
|
|
61
|
+
* @param {Environment} environment Target environment for the sequence.
|
|
62
|
+
* @throws {RequiredError}
|
|
63
|
+
* @memberof TaxSequencesApiInterface
|
|
64
|
+
*/
|
|
65
|
+
getNextNumberRequestOpts(requestParameters: GetNextNumberRequest): Promise<runtime.RequestOpts>;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the next available e-NCF number for a given invoice type and environment. Use this number as the `invoiceNumber` when submitting a document.
|
|
68
|
+
* @summary Get next available fiscal number
|
|
69
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
70
|
+
* @param {InvoiceType} type Invoice type code (e.g. \"31\" for Tax Credit Invoice).
|
|
71
|
+
* @param {Environment} environment Target environment for the sequence.
|
|
72
|
+
* @param {*} [options] Override http request option.
|
|
73
|
+
* @throws {RequiredError}
|
|
74
|
+
* @memberof TaxSequencesApiInterface
|
|
75
|
+
*/
|
|
76
|
+
getNextNumberRaw(requestParameters: GetNextNumberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetNextNumber200Response>>;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the next available e-NCF number for a given invoice type and environment. Use this number as the `invoiceNumber` when submitting a document.
|
|
79
|
+
* Get next available fiscal number
|
|
80
|
+
*/
|
|
81
|
+
getNextNumber(requestParameters: GetNextNumberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetNextNumber200Response>;
|
|
82
|
+
/**
|
|
83
|
+
* Creates request options for listTaxSequences without sending the request
|
|
84
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
85
|
+
* @param {InvoiceType} [type] Filter by invoice type (e.g. \"31\" for Tax Credit).
|
|
86
|
+
* @throws {RequiredError}
|
|
87
|
+
* @memberof TaxSequencesApiInterface
|
|
88
|
+
*/
|
|
89
|
+
listTaxSequencesRequestOpts(requestParameters: ListTaxSequencesRequest): Promise<runtime.RequestOpts>;
|
|
90
|
+
/**
|
|
91
|
+
* Returns all fiscal number sequences registered for the tenant.
|
|
92
|
+
* @summary List tax sequences
|
|
93
|
+
* @param {string} xTenantId UUID of the company or branch (tenant) making the request. Obtained from the Pronesoft portal after account setup.
|
|
94
|
+
* @param {InvoiceType} [type] Filter by invoice type (e.g. \"31\" for Tax Credit).
|
|
95
|
+
* @param {*} [options] Override http request option.
|
|
96
|
+
* @throws {RequiredError}
|
|
97
|
+
* @memberof TaxSequencesApiInterface
|
|
98
|
+
*/
|
|
99
|
+
listTaxSequencesRaw(requestParameters: ListTaxSequencesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListTaxSequences200Response>>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns all fiscal number sequences registered for the tenant.
|
|
102
|
+
* List tax sequences
|
|
103
|
+
*/
|
|
104
|
+
listTaxSequences(requestParameters: ListTaxSequencesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListTaxSequences200Response>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
109
|
+
export declare class TaxSequencesApi extends runtime.BaseAPI implements TaxSequencesApiInterface {
|
|
110
|
+
/**
|
|
111
|
+
* Creates request options for createTaxSequence without sending the request
|
|
112
|
+
*/
|
|
113
|
+
createTaxSequenceRequestOpts(requestParameters: CreateTaxSequenceOperationRequest): Promise<runtime.RequestOpts>;
|
|
114
|
+
/**
|
|
115
|
+
* Registers a new block of fiscal numbers for a given invoice type. The `from` and `to` values define the numeric range of the sequence.
|
|
116
|
+
* Create new tax sequence
|
|
117
|
+
*/
|
|
118
|
+
createTaxSequenceRaw(requestParameters: CreateTaxSequenceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
119
|
+
/**
|
|
120
|
+
* Registers a new block of fiscal numbers for a given invoice type. The `from` and `to` values define the numeric range of the sequence.
|
|
121
|
+
* Create new tax sequence
|
|
122
|
+
*/
|
|
123
|
+
createTaxSequence(requestParameters: CreateTaxSequenceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Creates request options for getNextNumber without sending the request
|
|
126
|
+
*/
|
|
127
|
+
getNextNumberRequestOpts(requestParameters: GetNextNumberRequest): Promise<runtime.RequestOpts>;
|
|
128
|
+
/**
|
|
129
|
+
* Returns the next available e-NCF number for a given invoice type and environment. Use this number as the `invoiceNumber` when submitting a document.
|
|
130
|
+
* Get next available fiscal number
|
|
131
|
+
*/
|
|
132
|
+
getNextNumberRaw(requestParameters: GetNextNumberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetNextNumber200Response>>;
|
|
133
|
+
/**
|
|
134
|
+
* Returns the next available e-NCF number for a given invoice type and environment. Use this number as the `invoiceNumber` when submitting a document.
|
|
135
|
+
* Get next available fiscal number
|
|
136
|
+
*/
|
|
137
|
+
getNextNumber(requestParameters: GetNextNumberRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetNextNumber200Response>;
|
|
138
|
+
/**
|
|
139
|
+
* Creates request options for listTaxSequences without sending the request
|
|
140
|
+
*/
|
|
141
|
+
listTaxSequencesRequestOpts(requestParameters: ListTaxSequencesRequest): Promise<runtime.RequestOpts>;
|
|
142
|
+
/**
|
|
143
|
+
* Returns all fiscal number sequences registered for the tenant.
|
|
144
|
+
* List tax sequences
|
|
145
|
+
*/
|
|
146
|
+
listTaxSequencesRaw(requestParameters: ListTaxSequencesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListTaxSequences200Response>>;
|
|
147
|
+
/**
|
|
148
|
+
* Returns all fiscal number sequences registered for the tenant.
|
|
149
|
+
* List tax sequences
|
|
150
|
+
*/
|
|
151
|
+
listTaxSequences(requestParameters: ListTaxSequencesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListTaxSequences200Response>;
|
|
152
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* eCF-Pronesoft Integration API
|
|
6
|
+
* ## Overview Production-grade API for issuing Electronic Tax Receipts (e-CF) in the Dominican Republic through the Pronesoft platform, which handles all communication with the DGII on your behalf. ## Authentication — OAuth 2.0 Client Credentials This API uses the **OAuth 2.0 Client Credentials** flow. There is no user login — authentication is machine-to-machine using a `clientId` and `clientSecret` issued by the Pronesoft portal. ### Step-by-step 1. **Get credentials**: - Sandbox: https://ecf.sandbox.pronesoft.com - Production: https://ecf.pronesoft.com 2. **Request a token** — call `POST /oauth/token` with your credentials. The server returns an `accessToken` valid for `expiresIn` seconds. 3. **Authorize requests** — include the token in every subsequent request: ``` Authorization: Bearer <accessToken> ``` 4. **Identify your tenant** — include your company/branch UUID in every protected request: ``` x-tenant-id: <your-tenant-uuid> ``` 5. **Refresh** — when the token expires, simply call `POST /oauth/token` again. ### Scopes | Category | Scope | Description | |---|---|---| | **Business** | `business:read` | Read company data | | | `business:create` | Create a new company | | | `business:update` | Update company data | | **Members** | `members:read` | View team members | | | `members:invite` | Invite new members | | | `members:revoke` | Revoke member access | | **Certificates** | `certificates:read` | View digital certificates | | | `certificates:upload` | Upload new certificates | | | `certificates:update` | Update existing certificates | | **Documents** | `documents:read` | List and view documents | | | `documents:create` | Create drafts or internal documents | | | `documents:send` | Submit e-CF to DGII | | | `documents:receive` | Receive e-CF from third parties | | | `documents:update` | Modify document metadata | | **Approvals** | `approvals:read` | View approval statuses | | | `approvals:commercial` | Perform commercial approvals/rejections | | **Sequences** | `sequences:read` | View NCF/e-NCF ranges | | | `sequences:create` | Request new sequences | | | `sequences:update` | Modify sequence configurations | | | `sequences:cancel` | Cancel unused sequences | | **Dashboard** | `business_info:read` | Access dashboard stats and metrics | | **Certification** | `certification:read` | View certification progress | | | `certification:write` | Run automated DGII certification tests | | **Reports** | `reports:read` | Generate and export reports (e.g. 606) | ## Environments | Environment | Portal | API Host | Purpose | |---|---|---|---| | Sandbox | https://ecf.sandbox.pronesoft.com | `api.ecf.sandbox.pronesoft.com` | Development & testing | | Production | https://ecf.pronesoft.com | `api.ecf.pronesoft.com` | Live e-CF issuance | ## Invoice Types (e-NCF) | Code | Name | |---|---| | `31` | Tax Credit Invoice (Factura de Crédito Fiscal) | | `32` | Consumer Invoice (Factura de Consumo) | | `33` | Debit Note (Nota de Débito) | | `34` | Credit Note (Nota de Crédito) | | `41` | Purchases (Compras) | | `43` | Minor Expenses (Gastos Menores) | | `44` | Special Regimes (Regímenes Especiales) | | `45` | Governmental (Gubernamentales) | | `46` | Exports (Exportaciones) | | `47` | Overseas Payments (Pagos al Exterior) |
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
* Contact: contacto@pronesoft.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.TaxSequencesApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class TaxSequencesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for createTaxSequence without sending the request
|
|
34
|
+
*/
|
|
35
|
+
createTaxSequenceRequestOpts(requestParameters) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['xTenantId'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('xTenantId', 'Required parameter "xTenantId" was null or undefined when calling createTaxSequence().');
|
|
39
|
+
}
|
|
40
|
+
if (requestParameters['createTaxSequenceRequest'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('createTaxSequenceRequest', 'Required parameter "createTaxSequenceRequest" was null or undefined when calling createTaxSequence().');
|
|
42
|
+
}
|
|
43
|
+
const queryParameters = {};
|
|
44
|
+
const headerParameters = {};
|
|
45
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
46
|
+
if (requestParameters['xTenantId'] != null) {
|
|
47
|
+
headerParameters['x-tenant-id'] = String(requestParameters['xTenantId']);
|
|
48
|
+
}
|
|
49
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
50
|
+
// oauth required
|
|
51
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("oauth2", ["sequences:create"]);
|
|
52
|
+
}
|
|
53
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
54
|
+
const token = this.configuration.accessToken;
|
|
55
|
+
const tokenString = yield token("bearerAuth", []);
|
|
56
|
+
if (tokenString) {
|
|
57
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
let urlPath = `/tax-sequences`;
|
|
61
|
+
return {
|
|
62
|
+
path: urlPath,
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: headerParameters,
|
|
65
|
+
query: queryParameters,
|
|
66
|
+
body: (0, index_1.CreateTaxSequenceRequestToJSON)(requestParameters['createTaxSequenceRequest']),
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Registers a new block of fiscal numbers for a given invoice type. The `from` and `to` values define the numeric range of the sequence.
|
|
72
|
+
* Create new tax sequence
|
|
73
|
+
*/
|
|
74
|
+
createTaxSequenceRaw(requestParameters, initOverrides) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const requestOptions = yield this.createTaxSequenceRequestOpts(requestParameters);
|
|
77
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
78
|
+
return new runtime.VoidApiResponse(response);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Registers a new block of fiscal numbers for a given invoice type. The `from` and `to` values define the numeric range of the sequence.
|
|
83
|
+
* Create new tax sequence
|
|
84
|
+
*/
|
|
85
|
+
createTaxSequence(requestParameters, initOverrides) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
yield this.createTaxSequenceRaw(requestParameters, initOverrides);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates request options for getNextNumber without sending the request
|
|
92
|
+
*/
|
|
93
|
+
getNextNumberRequestOpts(requestParameters) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
if (requestParameters['xTenantId'] == null) {
|
|
96
|
+
throw new runtime.RequiredError('xTenantId', 'Required parameter "xTenantId" was null or undefined when calling getNextNumber().');
|
|
97
|
+
}
|
|
98
|
+
if (requestParameters['type'] == null) {
|
|
99
|
+
throw new runtime.RequiredError('type', 'Required parameter "type" was null or undefined when calling getNextNumber().');
|
|
100
|
+
}
|
|
101
|
+
if (requestParameters['environment'] == null) {
|
|
102
|
+
throw new runtime.RequiredError('environment', 'Required parameter "environment" was null or undefined when calling getNextNumber().');
|
|
103
|
+
}
|
|
104
|
+
const queryParameters = {};
|
|
105
|
+
if (requestParameters['type'] != null) {
|
|
106
|
+
queryParameters['type'] = requestParameters['type'];
|
|
107
|
+
}
|
|
108
|
+
if (requestParameters['environment'] != null) {
|
|
109
|
+
queryParameters['environment'] = requestParameters['environment'];
|
|
110
|
+
}
|
|
111
|
+
const headerParameters = {};
|
|
112
|
+
if (requestParameters['xTenantId'] != null) {
|
|
113
|
+
headerParameters['x-tenant-id'] = String(requestParameters['xTenantId']);
|
|
114
|
+
}
|
|
115
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
116
|
+
// oauth required
|
|
117
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("oauth2", ["sequences:read"]);
|
|
118
|
+
}
|
|
119
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
120
|
+
const token = this.configuration.accessToken;
|
|
121
|
+
const tokenString = yield token("bearerAuth", []);
|
|
122
|
+
if (tokenString) {
|
|
123
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
let urlPath = `/tax-sequences/next`;
|
|
127
|
+
return {
|
|
128
|
+
path: urlPath,
|
|
129
|
+
method: 'GET',
|
|
130
|
+
headers: headerParameters,
|
|
131
|
+
query: queryParameters,
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Returns the next available e-NCF number for a given invoice type and environment. Use this number as the `invoiceNumber` when submitting a document.
|
|
137
|
+
* Get next available fiscal number
|
|
138
|
+
*/
|
|
139
|
+
getNextNumberRaw(requestParameters, initOverrides) {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
const requestOptions = yield this.getNextNumberRequestOpts(requestParameters);
|
|
142
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
143
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetNextNumber200ResponseFromJSON)(jsonValue));
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Returns the next available e-NCF number for a given invoice type and environment. Use this number as the `invoiceNumber` when submitting a document.
|
|
148
|
+
* Get next available fiscal number
|
|
149
|
+
*/
|
|
150
|
+
getNextNumber(requestParameters, initOverrides) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
const response = yield this.getNextNumberRaw(requestParameters, initOverrides);
|
|
153
|
+
return yield response.value();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Creates request options for listTaxSequences without sending the request
|
|
158
|
+
*/
|
|
159
|
+
listTaxSequencesRequestOpts(requestParameters) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
if (requestParameters['xTenantId'] == null) {
|
|
162
|
+
throw new runtime.RequiredError('xTenantId', 'Required parameter "xTenantId" was null or undefined when calling listTaxSequences().');
|
|
163
|
+
}
|
|
164
|
+
const queryParameters = {};
|
|
165
|
+
if (requestParameters['type'] != null) {
|
|
166
|
+
queryParameters['type'] = requestParameters['type'];
|
|
167
|
+
}
|
|
168
|
+
const headerParameters = {};
|
|
169
|
+
if (requestParameters['xTenantId'] != null) {
|
|
170
|
+
headerParameters['x-tenant-id'] = String(requestParameters['xTenantId']);
|
|
171
|
+
}
|
|
172
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
173
|
+
// oauth required
|
|
174
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("oauth2", ["sequences:read"]);
|
|
175
|
+
}
|
|
176
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
177
|
+
const token = this.configuration.accessToken;
|
|
178
|
+
const tokenString = yield token("bearerAuth", []);
|
|
179
|
+
if (tokenString) {
|
|
180
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
let urlPath = `/tax-sequences`;
|
|
184
|
+
return {
|
|
185
|
+
path: urlPath,
|
|
186
|
+
method: 'GET',
|
|
187
|
+
headers: headerParameters,
|
|
188
|
+
query: queryParameters,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Returns all fiscal number sequences registered for the tenant.
|
|
194
|
+
* List tax sequences
|
|
195
|
+
*/
|
|
196
|
+
listTaxSequencesRaw(requestParameters, initOverrides) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
const requestOptions = yield this.listTaxSequencesRequestOpts(requestParameters);
|
|
199
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
200
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ListTaxSequences200ResponseFromJSON)(jsonValue));
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Returns all fiscal number sequences registered for the tenant.
|
|
205
|
+
* List tax sequences
|
|
206
|
+
*/
|
|
207
|
+
listTaxSequences(requestParameters, initOverrides) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
const response = yield this.listTaxSequencesRaw(requestParameters, initOverrides);
|
|
210
|
+
return yield response.value();
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
exports.TaxSequencesApi = TaxSequencesApi;
|