Environment and base URL
Base URL
Every API Connect request points to:
https://ocote.io/api/connect
All routes in this documentation are relative to that base. For example, POST /invoice means:
POST https://ocote.io/api/connect/invoice
The API rejects requests over plain HTTP. Any integration must point to https://.
MH environments: test and production
The API Connect does not have two different hosts for test and production. The environment (test or real production) is determined by each company configured in Ocote, not by the URL.
- A company configured as environment 00 (test) issues test documents with no fiscal validity but with an MH test-environment stamp.
- A company configured as environment 01 (production) issues real documents with fiscal validity.
When you generate an API key from Ocote's panel, the key is bound to a company. That company already has its environment defined. In other words: your API key already knows whether it issues test or production, and there is no way to cross them by accident.
For the development and integration phase, request an API key against a company in test environment. To go to production, replace the key with one on a company in environment 01 and don't change anything else in your code.
Telling test from production on your side
When you issue a DTE, the returned control_number embeds the environment:
DTE-01-M001P001-000000000000123issued in test → its signed JSON and MH stamp includeambiente: "00".- The same document in production →
ambiente: "01".
If you need to block accidental production issuance in your own code, inspect the downloaded JSON via GET /file/{id}?type=json&key=… and validate the identificacion.ambiente field.
What gets generated by default
Every time you issue a DTE via the API, Ocote automatically generates, at no additional cost:
- Signed JSON (JWS) with MH stamp, available for download.
- Ticket PDF 8x21 cm for type 01 (Invoice) documents — usable for thermal printers.
- Document record in the company's historical archive, viewable from the Ocote DTE platform.
- Automatic email to recipient if the company has an SMTP template configured (optional).
You don't need to call extra endpoints for these files to exist. You just download them when needed. See Download files.
Support and contact
To obtain an API key, enable a company for production environment, or report an API issue, contact Ocote Software directly.