Crear nuevo DeCA
Este endpoint crea un nuevo Documento de Control Administrativo (DeCA), genera su PDF con QR y lo almacena en Azure Blob Storage.
Si se informa recipient, también envía una notificación al destinatario.
Llamada
curl -X https://decatest.solmicrosdh.com/api/control-documents \
--request POST \
--cert /ruta/al/certificado.pfx \
--cert-type P12 \
--pass mypfxpassword \
-H "Content-Type: application/json" \
-H "CompanyId: guid-unico-empresa" \
-d '{
"contractualCharger": {
"businessName": "string",
"taxIdentificationNumber": "string",
"address": "string"
},
"actualCarrier": {
"businessName": "string",
"taxIdentificationNumber": "string"
},
"shipments": [
{
"origin": "string",
"destination": "string",
"goodsNature": "string",
"packageCount": integer,
"weightKg": decimal,
"alternativeMagnitude": "string"
}
],
"vehicle": {
"licensePlate": "string",
"tractorLicensePlate": "string",
"semitrailerLicensePlate": "string",
"vehicleChange": "string"
},
"transportDate": "date",
"specialCirculationPermit": "string",
"remarks": "string",
"logo": "string",
"recipient": {
"channel": integer,
"address": "string",
"name": "string"
}
}'
Datos de entrada
| Propiedad | Tipo de dato | Requerido | Descripción |
|---|---|---|---|
| objetoDeCA | DeCA |
Sí | Datos del DeCA |
recipient |
Recipient |
No | Notificación del DeCA |
Reglas de validación destacadas:
contractualCharger.taxIdentificationNumberdebe ser NIF/NIE/CIF español válido.actualCarrier.taxIdentificationNumberadmite NIF/NIE/CIF español válido o un identificador fiscal extranjero tipo VIES (el transportista efectivo puede ser una empresa extranjera realizando transporte nacional).- En cada envío, informar
weightKgoalternativeMagnitude. - Si
weightKgse informa, debe ser positivo. - Si se informa
packageCount, debe ser positivo. - En conjuntos articulados,
tractorLicensePlateysemitrailerLicensePlatedeben venir ambos o ninguno. vehicle.licensePlatees obligatorio salvo que se informentractorLicensePlateysemitrailerLicensePlate(conjunto articulado completo), en cuyo caso es opcional.
Para más detalle de errores, ver Tratamiento de Errores.
Resultado
Si todo es correcto, devuelve 201 Created y la cabecera Location con la ruta del recurso.
Datos de respuesta
| Propiedad | Tipo de dato | Descripción |
|---|---|---|
id |
guid |
Identificador único del DeCA |
pdfUrl |
string |
URL pública del PDF generado |