📄 Get MIPYME document
This functionality is part of our “Plan factoring” and is only available for companies that use or have used the MIPYME system. This endpoint does not work for retrieving documents issued in market systems.
The /mipyme_get_document endpoint allows you to retrieve documents that were issued using the MIPYME system. This is particularly useful for companies that need to access historical documents or documents that were created in the MIPYME platform.
Important considerations
- This endpoint is only for companies that use or have used the MIPYME system
- It does not work for retrieving documents issued in market systems
- This functionality is part of our “Plan factoring”
- You will need the PFX certificate and password that were used in the MIPYME system
- The certificate must be valid and match the company’s RUT
Get a MIPYME document
In order to retrieve a MIPYME document, you need to use the /mipyme_get_document endpoint with the proper parameters. You will need:
-
The PFX certificate in base64 format
-
The certificate password
-
The company RUT (tax ID)
-
The document type according to SII
-
The document folio number
-
Endpoint: https://api-billing.koywe.com/V1/mipyme_get_document
-
Method: POST
-
Required headers:
- Content-Type: application/json
- Authorization: Bearer <token>
- Accept: */*
Request parameters
Response
The API will return a response with the following structure:
Response status codes
The status field indicates the result of the operation:
Example responses
Success response (status 0):
Error response - Invalid parameters (status 1):
Error response - Certificate error (status 2):
Error response - SII login error (status 3):
Error response - Document not found (status 5):
Certificate format
The certificate must be provided as a base64-encoded string of the PFX file. Make sure to:
- Use the exact certificate that was used in the MIPYME system
- Encode the entire PFX file content to base64
- Ensure the certificate is still valid and not expired
- Use the correct password associated with the certificate
Document types
The document_type_taxbureau parameter should match the SII document type codes: