Error Handling
DeCA API errors follow the standard ProblemDetails format.
Notes on the format:
titleis a fixed text depending on the error type ("Solicitud no válida"for400,"Recurso no encontrado"for404,"Eliminación no permitida"for409,"Servicio no disponible"for503).errorsis an array of{ "field": "...", "message": "..." }objects, one per validation error found.errorsis only present for400 Bad Requesterrors raised by business validation rules.
Most common HTTP codes:
400 Bad Request: missing required field, invalid tax identifier (Spanish NIF/CIF/NIE forcontractualCharger, or Spanish NIF/NIE/CIF / VIES-style foreign identifier foractualCarrier), incomplete articulated vehicle, invalid weight, or invalid notification address.401 Unauthorized: missingAuthorizationheader or invalid credentials.404 Not Found: no DeCA exists with the specifiedid.409 Conflict:DELETEonly; more than 7 days have passed since the DeCA was created, so it can no longer be deleted.503 Service Unavailable: error uploading PDF to Azure Blob Storage (operation is aborted).
Relevant validation rules:
contractualCharger,actualCarrier,shipments,vehicle, andtransportDateare required and must not be empty.contractualCharger.taxIdentificationNumbermust be a valid Spanish NIF/NIE/CIF.actualCarrier.taxIdentificationNumberaccepts a valid Spanish NIF/NIE/CIF or a VIES-style foreign tax identifier (ISO 3166-1 alpha-2 country code other thanES+ up to 12 alphanumeric characters with at least one digit), since the actual carrier may be a foreign company carrying out domestic transport.shipments[].weightKgmust be positive when provided.shipments[].packageCountis optional, but must be positive when provided.- Each shipment must include at least one of
weightKgoralternativeMagnitude. vehicle.tractorLicensePlateandvehicle.semitrailerLicensePlatemust both be present or both absent.vehicle.licensePlateis required unless bothvehicle.tractorLicensePlateandvehicle.semitrailerLicensePlateare provided (complete articulated combination), in which case it is optional and not printed on the PDF if omitted.recipient.addressmust be a valid email for Email channel or E.164 format for SMS/WhatsApp.logois optional; format is detected by byte signature during PDF/email generation.
Connection issues:
-
In the event of connection issues with SDH, you may encounter errors such as Unable to resolve the remote name: 'deca.solmicrosdh.com'.
You can test this by entering the URL https://deca.solmicrosdh.com/api into a browser.
It should display something like this:
-
Logos with a very large base64 representation may cause connection errors or result in a 403-Forbidden response.