DECA API · Test console

Guided examples for ERP, invoicing and fleet management integration.

Power Automate, AI and workflow automation

Connection guide, headers, JSON body and retry handling. DeCA documents accept idExterno up to 512 characters; master records retain 80.

Set up Power Automate

Test console

Requests are sent to the live API. Use a test key when creating or modifying records.

Open documentation and tests in Swagger

In examples that use master records, replace the customer, vehicle or driver identifiers with those previously returned for your company.

Dates are optional. Enter a start date, an end date, both or neither.

Open Swagger UI
Ready.

Response

{}

Integrator overview

Document responses include numeroEmpresa, the visible, read-only number for each company. Continue using idDeca, the global ID, in the Internal ID field and in all requests. Existing links do not change.

Always send the key in the HTTP header: X-Api-Key: tu_clave. It is not accepted in the URL or request body.

This console simplifies common tests. For all schemas, examples and responses, use the Official Swagger UI.

Available document and master-data endpoints: create update retrieve list find private link version history multi-stop trips customers and carriers vehicles drivers

RolesMethodKey parameters
CreatePOST JSONaccion=crear, trip details, lineas[]
UpdatePOST JSONaccion=actualizar, id, fields to change
ViewGETaccion=consultar&id=12; also returns matriculaTractora and matriculaRemolque (which may be null)
Get private linkGETaccion=enlace_edicion&id=12; returns the same active link or creates one
ListGETfechaCampo, fechaDesde, fechaHasta, noPlanificados=1
SearchGETaccion=buscar&origen=ERP_CLIENTE&idExterno=12345
History / PDFGET/api_versiones.php?id=12; for the current PDF: &actual=1
Bulk PDF downloadPOST / GET/api_descargas.php; creates a batch, reports progress and downloads a temporary ZIP
Create or update multi-stop tripPOST JSON/api_repartos.php with envios[]; each shipment includes origin, destination and lines
Synchronize master recordPOST JSONaccion=guardar and reference origenRegistro + idExterno
Import customersPOST JSON/api_clientes_importar.php; first validar then importar
API usersGET / POST JSON/api_usuarios.php; bulk import and personal key generation or revocation
Saved locationsGET / POST JSON/api_lugares.php; farms, warehouses and origin or destination points
Driver in PDFPOST JSONidConductor or conductores[], incluirConductorPdf, notaDeca and mostrarNotaDeca
PDF signature areasCustomer / importfirmaExpedidorPdf, firmaDestinatarioPdf and firmaTransportistaPdf; copied to each new DeCA
Get master recordGETid, ERP reference, q, activo, limit and offset
Bulk downloads are asynchronous: POST /api_descargas.php returns HTTP 202 and an idLote. Poll ?accion=estado&idLote=... until it is available, then download it from ?accion=descargar&idLote=.... Limit: 10,000 PDFs or 512 MB. The ZIP expires after 24 hours.
X-User-Api-Key replaces rather than accompanies X-Api-Key. A personal key assigns the DeCA to its authenticated user and applies that user's permissions. Bulk user administration requires the general company key.
Users can also be imported from CSV or Excel in the web application. When personal keys are generated or exported, their complete value is shown only once; exporting again regenerates the key and revokes the previous one.
Master data is optional. Synchronize customers, carriers, vehicles and drivers to share them with the web application, or send the contractual trip snapshot directly in each DeCA: cargadorNombre, cargadorNif, cargadorDomicilio, matriculaTractora, matriculaRemolque and the goods lines. The ERP link is retained using origenRegistro and idExterno. When creating a DeCA, you can send idCliente and idTransportista; their details are copied into the document to preserve the historical data. The creation response includes urlEdicion. Use modoEdicionTransportista=carga to also allow the description, quantity, unit and weight; mode operativo limits editing to the date and registration numbers. You may assign up to two drivers. The customer preference proposes whether they appear in the PDF, but each trip can override it. Only the name and authorised note are published, never an ID number, telephone or email.

One-off drivers and compatibility

POST api.php and POST api_repartos.php, with accion: crear or actualizar, support up to two drivers. Existing requests using idConductor or conductores: [{idConductor: 32}] remain supported without the new fields.

One-off driver without a master record

{"accion":"crear","fechaTransporte":null,"conductores":[{"nombre":"One-off driver","telefono":"600123456","email":"driver@example.com","notificarEmail":true}]}

For the shipments endpoint, add the envios collection. Omit idConductor or use null or 0. The name is required; phone is optional. One-off drivers default to email notifications: provide a valid email or send notificarEmail: false. Drafts without a PDF do not send automatic notifications.

The supplied text is preserved exactly, without adding a country code or removing spaces, signs or hyphens. Maximum 20 characters.

Override details for one trip

{"accion":"actualizar","id":123,"conductores":[{"idConductor":32,"nombre":"Name for this trip","telefono":"600123456","email":"trip-contact@example.com","notificarEmail":true}]}

The driver must belong to the company. Omitted driver fields are copied from the master record. Supplied details are saved in this DeCA without changing the master record or other documents. When updating, omit the entire conductores property to keep assignments, or send conductores: [] to clear them. A supplied list replaces all assignments.

Create or update the master record

Use the existing api_conductores.php endpoint with its usual permissions, then assign its idConductor to the DeCA. Document operations do not accept guardarFicha or implicitly change the catalogue.

Responses and other formats

Authenticated create, update and read responses include telefono, email and notificarEmail for each driver. idConductor remains an integer for master records and is null for one-off drivers. Existing endpoint and field names remain unchanged; new input fields are optional for existing integrations. Clients reading one-off drivers must support a null identifier.

The PDF only shows the name and authorised note according to incluirConductorPdf, never phone or email. api_nts.php retains its existing contract and catalogue handling; it does not automatically accept this REST object. MCP deca_actualizar accepts these fields inside cambiosJson; the abbreviated draft creation tool does not include a driver parameter.