The Spanish version is the authoritative reference. View in Spanish
📬 Response and error handling
Regardless of the channel (REST or Socket), xPOS Core returns a JSON object with two parts: a common core that always appears and an optional subset that depends on the country. Each country's sheet indicates which fields appear and how to interpret them.
Full response example
This is the full shape of the response: it includes all possible fields. Values appear as null when the country or the operation does not apply them.
{
"transactionId": null,
"message": null,
"custom_response": null,
"errorDescription": null,
"stage": null,
"number": null,
"docNumber": null,
"output": null,
"signedXml": null,
"input": null,
"barcodeText": null,
"barcodeBase64": null,
"countryIdentificationCode": null,
"statusCode": null,
"statusDescription": null,
"statusMessage": null,
"applicationResponse": null,
"timeGeneration": null,
"timeValidation": null,
"contingencyCode": null
}Core fields (all countries)
When message is Operation Error (or Operation Successful with an observation in code 200), the stage and errorDescription fields indicate exactly what happened. See the Error handling section for the integration contract and the full code catalog for the recommended action per stage.
Optional fields by country
Visual code (QR / PDF417)
Chile uses PDF417 and only returns
barcodeBase64. The rest of the countries use QR and return both fields.
Tax identification
Tax authority echo
These fields appear when the tax authority responds synchronously to the submission. Countries with an asynchronous response (Chile, Paraguay) do not return them in the initial response — they are queried later via /api/v1/status.
Contingency
Presence matrix by country
| Field | CL | CO | CR | SV | GT | PA | PY | DO |
|---|---|---|---|---|---|---|---|---|
barcodeText | – | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
barcodeBase64 | ✓¹ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
countryIdentificationCode | – | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
statusCode / statusDescription / statusMessage | – | ✓ | ✓ | ✓ | ✓ | ✓ | – | ✓ |
applicationResponse | – | ✓ | ✓ | ✓ | – | ✓ | – | ✓ |
timeGeneration | – | ✓ | ✓ | ✓ | – | ✓ | – | ✓ |
timeValidation | – | ✓ | ✓ | ✓ | – | ✓ | – | – |
contingencyCode | – | ✓ | ✓ | ✓ | ✓ | ✓ | – | ✓ |
¹ Chile returns barcodeBase64 in PDF417 format (not QR).
Each country sheet includes a response mock with illustrative values. See Communication by country.
🚦 Error handling
xPOS-Core expresses any anomalous result — validation error, tax authority rejection, contingency fallback or scheduled retry — through three core fields of the response: message, stage and errorDescription. The full catalog of stages lives in xPOS-Core error codes; this section describes the integration contract that the POS must respect to react to each case.
Response contract
When an operation does not end in success, xPOS populates the three fields like this:
Example of an error response: see the Response — Error tab at the top of this page.
Stage code vs. HTTP status
The stage code (200 / 400 / 404 / 503 / 510) that appears in the catalog is an internal operational label, not the HTTP status returned by the REST API. xPOS-Core delivers it inside the response body; the transport's HTTP status follows the standard API rules.
What the POS has to do
Each row of the catalog carries a suggested action that the POS should adopt as a contract:
| Action | POS decision |
|---|---|
| Correct and retry | The input is responsible. Correct the data indicated by errorDescription and resend POST /api/v1/process-documents. |
| Retry | Transient error (network, token, temporary validation). Resend as is. |
| Reload and retry | The xPOS local state is not healthy (folios, certificates, templates). Call PUT /api/v1/reobtain-config and resend. |
| Correct | Review the case without resending automatically (the tax authority already responded and leaves the action to the operator). |
| End of process | No POS action required (duplicate document, automatic retry scheduled in xPOS, or manual escalation to Gosocket). |
When the POS loses the response
If the network was cut or the POS restarted before processing the response, there is no need to resend the document: the GET /api/v1/status endpoint retrieves the original response from the transactionId or the docNumber — see Status re-retrieval. For deeper diagnosis (audit, escalation), the operational logs at GET /api/v1/db-data/logs are filtered by uuid or free metadata.