Create new DeCA
This endpoint creates a new Administrative Control Document (DeCA), generates its PDF with QR code, and stores it in Azure Blob Storage.
If recipient is provided, a notification is also sent.
Call
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"
}
}'
Request fields
| Property | Data type | Required | Description |
|---|---|---|---|
| DeCAObject | DeCA |
Yes | DeCA data |
recipient |
Recipient |
No | DeCA Notification |
Key validation rules:
contractualCharger.taxIdentificationNumbermust be a valid Spanish NIF/NIE/CIF.actualCarrier.taxIdentificationNumberaccepts a valid Spanish NIF/NIE/CIF or a VIES-style foreign tax identifier (the actual carrier may be a foreign company carrying out domestic transport).- Each shipment must include
weightKgoralternativeMagnitude. - If
weightKgis included, it must be positive. - If
packageCountis included, it must be positive. - For articulated vehicles,
tractorLicensePlateandsemitrailerLicensePlatemust both be present or both absent. vehicle.licensePlateis required unless bothtractorLicensePlateandsemitrailerLicensePlateare provided (complete articulated combination), in which case it is optional.
For full error details, see Error Handling.
Result
On success, returns 201 Created and a Location header with the resource path.
Response fields
| Property | Data type | Description |
|---|---|---|
id |
guid |
Unique DeCA identifier |
pdfUrl |
string |
Public URL of the generated PDF |