# Result Codes and Errors

This reference lists **all result and error codes** returned by the TPVPC. TpvpcImplantado uses the same codes.

This guide applies to **Slim Pack**.

The Get Central integration exposes **two distinct layers of result information**, which must never be confused:

1. **Library return codes** – returned directly by the function call (`int`)
2. **Financial response codes** – returned inside the XML response

Both layers are mandatory for correct error handling.

## System Return Codes

Every TPVPC function returns a numeric code immediately, before any XML response. A `0` means the call finished; it says nothing about whether the payment was authorized.

**The same number means different things depending on which function returned it.** Read
the code against the function you called, not against a single global list.

### Initialization — `fnDllIniTpvpcLatente` and `fnDllIniTpvpcLatenteExt`

| Code | Description |
| ---: | :--- |
| `-1` | Internal system error. Reload the dynamic library; if it persists, report it to the acquirer. |
| `-2` | Failed to load the configuration XML. |
| `-3` | `datosConf/datosComercio/comercio` has no value. |
| `-4` | `datosConf/datosComercio/terminal` has no value. |
| `-5` | `datosConf/datosComercio/clave` has no value. |
| `-6` | `datosConf/accesoUsuario/usuario` has no value. |
| `-7` | `datosConf/accesoUsuario/clave` has no value. |
| `-8` | `datosConf/modo` has no value. |
| `-9` | Neither merchant-data access nor user access was specified. One of the two is mandatory. |
| `-10` | `datosConf/confDispositivo/puerto` has no value. If you are not using a PIN pad, omit the `confDispositivo` element entirely; if you include it, configure every child element. |
| `-11` | `datosConf/confDispositivo/version` has no value. |
| `-12` | Internal system error. |
| `-13` | PIN pad discovery failed: the maximum wait TimeOut was exceeded. |
| `-14` | The TPVPC Latente graphical interface could not start. |
| `-16` | Communication problem with the TPVPC web service. Check the internet connection and initialize again once the service is back. |
| `-18` | The request reaches the TPVPC, but one of the values is wrong. Check the merchant code, the terminal and the signature key. |
| `-19` | The PIN pad is not configured correctly. Contact the acquirer. |
| `-20` | The communication port specified is not correct. |
| `-21` | The version specified is incompatible with the installed PIN pad. Ask the acquirer for the correct value. |
| `-40` | The library version has expired and must be updated. |

### Transaction operations — `fnDllOperPinPad`, `fnDllOperManualExt`, `fnDllOperPinPadDCC`

| Code | Description |
| ---: | :--- |
| `-1` | The configuration data was not set correctly. Call `fnDllIniTpvpcLatente` again; if it persists, contact the acquirer. |
| `-2` | The TimeOut set by the application was exceeded. |
| `-3` | System error. The application must be restarted. |
| `-4` | The input data is not correctly formatted. Check the parameter list. |
| `-13` | One of the parameters is not valid. Check the parameter list. (`fnDllOperPinPad` only.) |
| `-17` | The response buffer is not large enough. Use the value given in the documentation. |
| `-18` | One parameter has the wrong format. For example, `cImporte` must be `#000.00`: 3000 euros is `3000.00`. |

> **Critical rule**: if a transaction function returns `-2`, the TimeOut expired and the
> final result of the operation is **unknown**. Run a query before retrying, so you do not
> charge twice. This rule applies here only: during initialization, `-2` means the
> configuration XML could not be loaded.

### Query and close operations — `fnDllOperConsulta`, `fnDllOperTotales`, `fnDllOperComContable`

| Code | Description |
| ---: | :--- |
| `-1` | The configuration data was not set correctly. Call `fnDllIniTpvpcLatente` again. |
| `-2` | An internal system error occurred while running the operation. If it persists, contact the acquirer. |
| `-3` | Error in the input parameters. |
| `-12` | Internal system error. |
| `-15` | Operation not supported. (`fnDllOperConsulta` and `fnDllOperTotales`.) |

## Financial Response Codes (XML)

Financial response codes are returned **inside the XML response** and represent the actual authorization decision made by the issuer network.

The `<estado>` element reports the operation's processing state: `F` (finished), `P` (in progress), `T` (technical failure), or `G` (denied).

A transaction is **AUTHORIZED only if**:

```xml
<estado>F</estado>
<resultado>Autorizada</resultado>
```

Numeric codes must be interpreted only after this validation.

---

### Approval Codes

|    Code Range | Meaning          | Description                                  |
| ------------: | ---------------- | -------------------------------------------- |
| `0000`–`0099` | Approved         | Transaction authorized.                      |
|        `0900` | Partial approval | Approved for an amount lower than requested. |

---

### Denial Codes

|   Code | Description                                  |
| -----: | -------------------------------------------- |
| `0101` | Expired card.                                |
| `0102` | Suspected fraud.                             |
| `0104` | Restricted card.                             |
| `0116` | Insufficient funds.                          |
| `0118` | Card not allowed for this operation.         |
| `0129` | CVV error.                                   |
| `0180` | PIN entry required.                          |
| `0181` | Incorrect PIN.                               |
| `0184` | PIN attempts exceeded.                       |
| `0190` | Issuer declined transaction without details. |
| `0191` | Issuer unavailable.                          |
| `0200` | Do not honor.                                |
| `0202` | Card reported stolen.                        |
| `0204` | Card reported lost.                          |
| `0208` | Transaction not permitted.                   |
| `0211` | Invalid card number.                         |
| `0212` | Invalid transaction.                         |
| `0222` | Security violation.                          |
| `0907` | Issuer communication error.                  |
| `0912` | Issuer not responding.                       |
| `0960` | System malfunction.                          |

---

## Error Handling Rules

1. Always evaluate the **library return code first**.
2. If the return code is not `0`, do **not** assume any financial result.
3. If the return code is `0`, parse the XML response and validate `<estado>` and `<resultado>`.
4. If the return code is `-2`, perform a **status query** before retrying.
5. Never retry a financial operation blindly.

---

## Best Practices

* Do not map numeric response codes directly to success or failure.
* Always rely on XML authorization fields as the source of truth.
* Persist response codes for reconciliation and audit purposes.
* Handle timeouts and communication errors explicitly.

This page defines the complete and authoritative set of result codes required for a safe and compliant Get Central integration.