> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/documentacion-editran-editran-sepa-v3-open-en/adaptacion-para-pagos-telematicos-de-la-tgss.md).

# Adaptation for TGSS Telematic Payments

To make it easier for our customers to integrate the full TGSS Telematic Payments protocol with the SEPA converter, the two additional mappings detailed in this document have been implemented.

## 10.1 Receipt of the files

Entities will receive the files from TGSS in XML format, according to the schema `pain.001.001.03.xsd` of ISO 20022.

**XML (pain.001.001.03) → Converter → Flat file: TGSS header record + SEPA 34-14 file**

The content of the tag `<MsgId>` of these XML files is:

* Sending type (2 positions):
* File creation date, 6 positions (AAMMDD)
* NRBE of the paying financial entity (4 positions)
* Reference (20 positions)

Under the specific indication of the parameter `param.Cabecera`, when these files go through the Converter, they will be translated into flat format.

> **Attention:** if you do not want to add that header to all 34-14 standard files that go through the converter, `param.Cabecera` it will be specified as a Java virtual machine parameter in the corresponding script of the Editran session, and not in the file `Configuracion.properties` (see section [5 Onesait Ecosystems Configuration · Editran/SEPA](#5-configuración-de-onesait-ecosystems--editransepa)). The use of this parameter ignores any value given to `param.resp.auto` if the file to be converted is of the 34-14 standard.

The content of the resulting file will be the TGSS header record that was defined at the time, whose structure is detailed below, followed by the sepa 34-14 file.

**TRANSMISSION HEADER RECORD (flat format)**

| Field       | Description                                                                                                                                                                                        |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FIELD A** | Header Record Code. Numeric field of 2 positions. Its value will be `01`                                                                                                                           |
| **FIELD B** | Standard Code. Numeric field of 2 positions. Its value will be `34`                                                                                                                                |
| **FIELD C** | Operation Type. Numeric field of 2 positions. Its value will be `14`                                                                                                                               |
| **FIELD D** | Sending type I. Numeric field of 2 positions. Its possible values are: `50` - R03 transfer files, electronically signed                                                                            |
| **FIELD E** | Sending type II. Numeric field of 2 positions. Its values will be as follows: `01` - For all the previous types of sending (Possibility of including `06` in some specific case in later versions) |
| **FIELD F** | Client Reference: **F1** File creation date (numeric, 6 positions); **F2** File Creation Time (numeric, 4 positions); **F3** Financial Entity Code (numeric, 6 positions)                          |
| **FIELD G** | Client Reference Extension. Alphanumeric field of 20 positions. It will contain the number of the R and the Paying Box                                                                             |
| **FIELD H** | Variable-length field up to 600                                                                                                                                                                    |

The mapping performed by the Converter is as follows:

> TGSS header record: `01` + `34` + `14` + first two characters of the tag `<MsgId>` + `01` + following six characters of `<MsgId>` + `000000` + remaining twenty-four characters of `<MsgId>` + 554 spaces.

## 10.2 Sending the confirmation

TGSS expects to receive from the entities an XML confirmation file according to the schema `pain.002.001.03.xsd`.

**TGSS Confirmation → Converter → XML (pain.002.001.03)**

Those users who have generated them in their applications in flat format and according to the following structure can obtain it with the Converter:

**CONFIRMATION RESPONSE FILE (flat format)**

| Field       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **FIELD A** | Identification of the CSB Ledger and Type of Operation. Its value will be `3414`                                                                                                                                                                                                                                                                                                                                                                                           |
| **FIELD B** | Identification of the transmitted file: **B1** corresponds to FIELD F1 of the Transmission Header Record; **B2** corresponds to FIELD F2; **B3** corresponds to FIELD F3                                                                                                                                                                                                                                                                                                   |
| **FIELD C** | Identification of the Issuing Entities: **C1** Reserved (12 positions); **C2** Identification of the Entity, alphanumeric (40 positions)                                                                                                                                                                                                                                                                                                                                   |
| **FIELD D** | Identification of the Financial Entity: **D1** NRBE of the Entity, numeric (4 positions); **D2** Reserved (4 positions)                                                                                                                                                                                                                                                                                                                                                    |
| **FIELD E** | Data for the Quadrant: **E1** Total Number of Records shown in the logical file trailer record, numeric (10 positions); **E2** Total Amount shown in the logical file trailer record, numeric (17 positions); **E3** Number of Records in the Received File, numeric (10 positions); **E4** Total Sum of Amounts of the Received File, numeric (17 positions). *Note: in the first version, where there is a single physical file, fields E1 and E2 will appear as zeros.* |
| **FIELD F** | Control Codes: **F1** Transmission Result Code, numeric (2 positions); **F2** Reserved for future codes, numeric (2 positions), its value will be `00`                                                                                                                                                                                                                                                                                                                     |
| **FIELD G** | Additional Customer Verification Information: **G1** corresponds to FIELD D of the Transmission Header Record; **G2** corresponds to FIELD E; **G3** corresponds to FIELD G; **G4** Reserved (8 positions)                                                                                                                                                                                                                                                                 |

The mapping performed by the Converter is as follows:

* `<CstmrPmtStsRpt><GrpHdr><MsgId>`: G1 + B1 + positions 2 to 5 of B3 + G3
* `<CstmrPmtStsRpt><GrpHdr><CreDtTm>`: in ISODateTime format `YYYY-MM-DDThh:mm:ss`. First and second digits of B1, formatted as `YYYY` + "-" + third and fourth digits of B1 + "-" + fifth and sixth digits of B1 + "T00:00:00"
* `<CstmrPmtStsRpt><OrgnlGrpInfAndSts><OrgnlMsgId>`: same content as `<CstmrCdtTrfInitn><GrpHdr><MsgId>`
* `<CstmrPmtStsRpt><OrgnlGrpInfAndSts><OrgnlMsgNmId>`: `pain.001.001.03`
* `<CstmrPmtStsRpt><OrgnlGrpInfAndSts><OrgnlCtrlSum>`: E4 (with the two rightmost digits separated by '.')
* `<CstmrPmtStsRpt><OrgnlGrpInfAndSts><GrpsSts>`: `ACTC` if F1 is `00`, `RJCT` for any other value.
* `<CstmrPmtStsRpt><OrgnlGrpInfAndSts><GrpsSts><StsRsnInf><Rsn><Cd>`: according to the content of F1 and provided that it is different from `00`.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.editran.onesait.com/documentacion-editran/documentacion-editran-editran-sepa-v3-open-en/adaptacion-para-pagos-telematicos-de-la-tgss.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
