Skip to main content

Overview

The AltaMulta endpoint allows you to register a new traffic violation (multa) in the system. The violation is uniquely identified by the municipality code and the expedition number within that municipality.

Endpoint

POST /AltaMulta

Authentication

This endpoint requires authentication. You must obtain expedition number ranges using the ObtenirRang() function before creating violations. The expedition number must be within the requested range.

Content Type

  • Consumes: application/xml
  • Produces: application/xml

Request Body

The request body must contain violation data in XML format as a MultaType object.
Critical: Fields in the MultaType XML must be ordered alphabetically. Non-alphabetical ordering will cause the request to fail.

Request Schema

pMulta
MultaType
required
Violation data in XML format with alphabetically ordered fields

Response

Success Response (200)

Returns a tRetorn object with the operation result.
CodiRetorn
integer
required
Return code indicating the result:
  • 0: Success - violation created successfully
  • -1: Failed to add violation to database
  • Negative value (not -9000): Database error
  • -9000: Other error (non-database)
DescRetorn
string
Error description (empty on success)

Error Codes

CodeDescription
0Success
-1Failed to add violation to database
-9000Unhandled exception
Other negativeDatabase error

Examples

Request Example

<MultaType xmlns="http://schemas.datacontract.org/2004/07/WcfMultesPDA">
  <Cdagen>220</Cdagen>
  <Cdasig>S</Cdasig>
  <Cdclie>088</Cdclie>
  <Cdcond>C</Cdcond>
  <Cdexpa>P090018145</Cdexpa>
  <Cdiden/>
  <Cdmatr>1234ABC</Cdmatr>
  <Cdmunc>245</Cdmunc>
  <Cdposc>08923</Cdposc>
  <Cdrefe/>
  <Codvia>CR</Codvia>
  <Color>GRIS</Color>
  <Desamp1/>
  <Desamp2/>
  <Desamp3/>
  <Desamp4/>
  <Desamp5/>
  <Dsadrc>CARRER ARAGO 38</Dsadrc>
  <Dslloc>VIA PÚBLICA</Dslloc>
  <Dsmunc>SANTA COLOMA</Dsmunc>
  <Dspais>ESPAÑA</Dspais>
  <Dsprov>BARCELONA</Dsprov>
  <Dtcoca/>
  <Dtinfr>20250406</Dtinfr>
  <Dtmenor>20020101</Dtmenor>
  <Foto>/9j/YZVDELmjozSniHHQ//2Q2A==</Foto>
  <Hmmult>1234</Hmmult>
  <Identi>00000000T</Identi>
  <Idepda>353947020131525</Idepda>
  <Immult>600</Immult>
  <Imppag>300</Imppag>
  <Marca>SEAT</Marca>
  <Model>MALAGA</Model>
  <Nmmobi>123456</Nmmobi>
  <Nom/>
  <Numvia>12</Numvia>
  <Orivia>O</Orivia>
  <Quiden>A</Quiden>
  <Resident>S</Resident>
  <Retcar>S</Retcar>
  <Snfoto>S</Snfoto>
  <Snmeno>S</Snmeno>
  <Snsign>S</Snsign>
  <Sqcond>8430</Sqcond>
  <Tpmatr>2</Tpmatr>
  <Tpvehi>1</Tpvehi>
  <Viapen>N</Viapen>
</MultaType>

Success Response Example

<tRetorn xmlns="http://schemas.datacontract.org/2004/07/WcfMultesPDA" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <CodiRetorn>0</CodiRetorn>
  <DescRetorn/>
</tRetorn>

Important Notes

  • Field ordering must be strictly alphabetical in the XML request
  • The expedition number (Cdexpa) must be within the range obtained from ObtenirRang()
  • The municipality code (Cdclie) must be valid (use ObtenirMunicipis() to get valid codes)
  • Photos must be Base64 encoded
  • Date fields use yyyyMMdd format
  • Time fields use HHmm format (24-hour)
  • Boolean-like fields use ‘S’ for Yes (Sí) and ‘N’ for No
  • GET /Consulta - Query an existing violation
  • GET /AltaAnulada - Cancel a violation
  • GET /ObtenirRang - Obtain expedition number ranges
  • GET /ObtenirMunicipis - Get list of valid municipality codes

Build docs developers (and LLMs) love