preregister
ANNEX XII. MASS PROCESING FLOW
P3 Mass Processing: Flow Description
P3 Mass Processing provides a specialized flow for the bulk processing of preregistrations, designed to handle high‑volume requests that cannot be processed through the Online Preregistration service.
Currently, this flow supports two operations:
- Preregistration
- Cancellation
The process accepts JSON files containing preregistration requests for Letters (RV) and packages, using exactly the same format as the requests managed by P3 Online for both Preregistration and Cancellation operations.
File processing is performed asynchronously, including:
- Validation of the received data
- Execution of the preregistration or cancellation operations
- Generation of a JSON response file containing the result of the processing
For the Preregistration operation, and unlike P3 Online, the generated response will include both the codes of the shipments successfully preregistered and the detailed validation errors that may occur during file processing.
Usage Conditions
To allow a client to use the mass processing flow, it must first be configured in CONVIERTA, providing all the required information to enable the integration.
For more information about CONVIERTA, please contact a Correos Commercial representative.
Files processed by P3 Mass Processing must follow the same format as Online requests, for both Preregistration and Cancellation operations.
It is mandatory that the files include the Preregistration Code corresponding to the packages to be preregistered (field packages -> packageCode).
Once the file has been processed, the response generated by P3 Mass Processing will be sent directly to CONVIERTA, which will then deliver the response file to the client.
Input File
The file that the client must provide for processing must be in JSON format.
The file name is typically composed of:
prefix + contractNumber + clientNumber + date + time + extension
For example:
FD12345678_9998765432_20250101153030.jsonInternal Structure
The file must include all the information required for the preregistration of each shipment. For more details on the specific fields, please refer to the P3 API documentation.
The file content enables the creation of new preregistrations, including, among others, the following data:
- Product / service type.
- Associated contract / detailed service / labeler.
- Parcel information (characteristics and logistical data).
- Recipient details.
- Sender details.
- Additional values (optional).
Additionally, the file may include preregistrations previously created via the bulk flow that need to be cancelled.
This mechanism is designed to process a larger volume of data than the online preregistration operation of the API. Therefore, within the shipments field, you may include as many shipments as required.
In the annulments field, you must specify the parcel codes to be cancelled, using an array that allows multiple entries.
Example:
{
"errorCodeLanguage": "spa",
"application": "P3",
"shipments": [
{
"admissionProvince": "28",
"packagesNumber": "10",
"product": "PAFXB",
"deliveryMethod": "DOUAOF",
"frankingType": "FP",
"totalWeight": "10000",
"contractNumber": "12345678",
"clientNumber": "9998765432",
"labellerCode": "AB12",
"packages": [
{
"packageId": "TEST",
"packageHeight": "1500",
"packageWidth": "1000",
"packageLength": "100",
"packageWeightGrams": "200",
"clientReference": "TEST",
"clientReference2": "TEST",
"packageCode": "PQAB129800001020128001A",
"packageContents": {
"shipmentType": "2",
"customsData": [
{
"quantity": "1",
"description": "456",
"netWeight": "100",
"netValue": "11.91",
"tariffNumber": "101010",
"countryOrigin": "DEU"
}
]
}
}
],
"addressee": {
"name": "Test Addressee",
"address": "11 AVENUE DU TEST",
"locality": "MADRID",
"cp": "28001",
"country": "ESP"
},
"sender": {
"name": "Test Sender",
"address": "Calle Rejas 9",
"locality": "Madrid",
"cp": "28022",
"country": "ESP"
},
"additionalValues": [
{
"additionalValueId": "VADEPA",
"fields": [
{
"fieldId": "1",
"value": "250"
}
]
}
]
},
{
// shipment details 2 ...
},
{
// shipment details 3 ...
}
]
,
"annulments": [
"PQ9TTF9800000010128001N",
"PL26CS9800006230125001L",
"PK9TTF9800000010428001D"
]
}Output File
Once the information from the input JSON is processed, a response file is generated and sent to the destination path provided by CONVIERTA.
The JSON content will indicate the processing result of each shipment (shipments) from the input file, specifying whether it was successful or if an error occurred. The JSON format is similar to that of the online API when performing a preregistration.
Example:
{
"fileIdentifier": "nombreAplicación_fechaGeneraciónFichero",
"result": "1",
"shipments": [
{
"validationErrorCount": 2,
"error": [
{
"errorCode": 1007,
"description": "El producto-pais no existe",
"errorFieldName": "cod_pais"
},
{
"errorCode": 5012,
"description": "Valor de admissionMethod o deliveryMethod no permitido",
"errorFieldName": "admissionMethod/deliveryMethod"
}
],
"packages": [
{
"packageId": "Test",
"packageCode": "PQAB129800001020128028Z"
}
]
}
…
]
"annulments": [
{
"errors": null,
"message": "Preregistro Anulado con éxito",
"packageCode": "PQ9TTF9800000010128001N"
},
{
"errors": [
{
"errorCode": 6068,
"description": "Esta operación no está permitida para este producto. Se debe anular por expedición",
"errorFieldName": "product"
}
],
"message": "Ha ocurrido un error al tratar de anular el preregistro",
"packageCode": "PL26CS9800006230125001L"
},
{
"errors": [
{
"errorCode": 7001,
"description": "El envÃo está admitido",
"errorFieldName": "shipment"
}
],
"message": "Ha ocurrido un error al tratar de anular el preregistro",
"packageCode": "PK9TTF9800000010428001D"
}
…
]
}