Return File 3.2
- Goals
- Definitions
- File Structure
- Record format
- Record 0 – Header
- Record 1 - Sale Details
- Record 10 - Credit Details
- Record 2 – Adjustments
- Record 100 – Anticipation Batch
- Record 200 – Anticipated transactions
- Record 9 – Trailer
- Remark
- Limitations
- Template for saving to database
- Code table
- Version Changes
1. Goals
-
The detailed return file generated on disk is intended to allow the custommer's back-end syston to download the outstanding bills. '
Target Audience: Any and all customers that need to save data to disk.
-
The detailed return file generated in the customer's database is intended to allow
that the back-end system can download the outstanding bills to a table created and managed by the customer. 'Target audience: Environments that use database as an interface and are managed by DBAs.
-
The generated consolidated file is used to check the values recorded in the map of
store cash against the value recorded by SiTef, for payment transactions with
credit, debit and benefit cards.
2. Definitions
-
The generation of the file is done through the "Report" interface, requiring only the
“Start Date”, “End Date” and version information. -
Files saved to disk will be generated in CSV format, that is, the fields are
separated by sonicolons (“;”). -
Os arquivos também podem ser gerados em banco de dados desde que, previamente
configurados e criadas suas respectivas tabelas(1 tabela para cada tipo de registro) com
colunas na correspondentes as colunas configuradas para cada um dos registros.Important: Any and all managonent in this database and/or tables is the customer's responsibility, the Syston only feeds the previously existing tables. If they do not exist, an error will be returned when generating the file. More details in iton 5.2. '
-
Only the fields available according to each network are present.
-
In case there is no content for the field, for files saved to disk, there will be the
separator (“;”), making the number of fields of each “Fixed” record independent of the network.
In the case of output to database, the field will be sent as “blank”. -
In the case of Non-TEF transactions, the NSU Sitef field will contain the Receipt Number.
-
If the user selects the date type as "Sale Date", only the Record data
Sale details (in addition to Header and Trailer) will be filled. This change has occurred so
that the created file is immutable regardless of the present date.
In the case of "Credit Date", the other fields will be filled, they are: Credit Details,
Anticipation Batch, Advance Transactions and Adjustments, in addition to the Header and Trailer; -
In the case of output to database, neither Header nor Trailer will be generated, only Details will be generated.
-
The ordering, all ascending, of the records for the Sale Details field will be:
- Sale Date
- Idt Rede
- Codlojasitef
- TipoProduto
- NSU SiTef
- Installment Number
-
The ordering, all ascending, of the records for the Credit Details field will be:
- Credit Date
- Idt Rede
- Codlojasitef
- TipoProduto
- NSU SiTef
- Installment Number
-
The ordering, all ascending, of the records for the Adjustments field will be:
- Adjustment Date
- Idt Rede
- Codlojasitef
-
The ordering, all ascending, of the records for the Anticipation Batch field will be:
- Anticipation Credit Date
- Idt Rede
- Codlojasitef
- Summary number
- Installment
-
The ordering, all ascending, of the records for the Anticipated Transactions field will be:
- Sale Date
- Idt Rede
- Codlojasitef
- TipoProduto
- NSU SiTef
-
The default filename format for saving to disk will be:
-
Detailed file: “Det<Nome_Rede><Data_Atual>.csv”
-
Where:
- <Nome_Rede>, Network Name, or “miscellaneous” when two or more authorizers are selected.
- <Data_Atual> in the format YYMMDD.
-
-
The output to database requires the creation of a table for each type of Detail Record.
3. File Structure
Saved on disk:
0 – Header
1 – Sale Details*
.
.
10 – Credit Details*
.
.
2 – Adjustments
.
.
100 – Anticipation Batch
.
.
200 – Anticipated Transactions
.
.
9 - Trailer
* For transactions in installments, one (1) record of this type will be generated per installment.
Saved in a database, they need 5 tables "Sales", "Credit", "Adjustments", "Anticipation Batch" and "Anticipated Transaction":
1 – Sale Details*
.
.
10 – Credit Details*
.
.
2 – Adjustments
.
.
100 – Anticipation Batch
.
.
200 – Anticipated Transactions
.
.
* For transactions in installments, one (1) record of this type will be generated per installment.
4. Record format
Record 0 – Header
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| H01 - Record type | 1 | 1 | ‘0’ |
| H02 - File creation date | 8 | 8 | YYYYMMDD |
| H03 - File creation time | 6 | 6 | HHMMSS |
| H04 - Period - Start Date | 8 | 8 | YYYYMMDD |
| H05 - Period - End Date | 8 | 8 | YYYYMMDD |
| H06 - Layout Version | 5 | 5 | ‘V3.2’ |
| H07 - network identifier code | 1 | 3 | ‘00’ – More than one selected Network See Table I |
| H08 - File sequential number | 14 | 14 | |
| H09 - Sequential number of record in file | 6 | 6 |
Record 1 - Sale Details
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| V01 - Record Type | 1 | 1 | ‘1’ |
| V02 - Transaction Identifier | 1 | 30 | Custommer Code |
| V03 - Company Code | 1 | 15 | ‘’ |
| V04 - Sale Date | 8 | 8 | YYYYMMDD |
| V05 - Summary Number | 1 | 10 | ‘’ |
| V06 - receipt Number | 1 | 12 | ‘’ |
| V07 - SiTef's NSU | 1 | 12 | * |
| V08 - Credit Card Number | 1 | 19 | ‘’ |
| V09 - Gross Value | 3 | 16 | No cent separator Gross Value of the installment, if divided into installments |
| V10 - Total Installments | 2 | 2 | For cash transactions = “00” |
| V11 - Net value | 1 | 16 | No cent separator Value of the installment, if divided into installments |
| V12 - Credit Date | 8 | 8 | YYYYMMDD |
| V13 - Installment Number | 2 | 2 | Installment Number |
| V14 - Product Type | 1 | 1 | ‘C’ - credit ‘D’ – debit ‘V’ – voucher ‘S’ – withdraw |
| V15 - Capture | 1 | 1 | ‘0’, ‘2’, ‘3’ – SiTef ‘1’, ‘4’ , ‘5’ – Others |
| V16 - Network identity code | 1 | 3 | [See table I](code table) |
| V17 - Bank Number | 1 | 6 | ‘’ |
| V18 - bank branch number | 1 | 6 | ‘’ |
| V19 - checking account number | 1 | 15 | ‘’ |
| V20 - commission amount | 3 | 16 | No cent separator |
| V21 - Service Fee Amount | 3 | 5 | No cent separator Eg: 199 = 1,99 % |
| V22 - CodLojaSiTef | 8 | 8 | |
| V23 - Authorization Code | 0 | 12 | ** |
| V24 - Invoice | 0 | 20 | Invoice |
| V25 - Credit Card Company Code | 4 | 4 | [See Table II](code table) |
| V26 – Date Sale Sitef | 1 | 8 | YYYYMMDD if it doesn't exist ‘’ |
| V27 – Sale Time Sitef | 1 | 6 | HHMMSS if it doesn't exist ‘’ |
| V28 - Sequential number of record in file | 6 | 6 |
* For NON-TEF transactions, this field is filled in with the Voucher Number information (V06).
** In the case of Redecard Debit, Goodcard and Tecban, this data is not available in electronic statements.
Record 10 - Credit Details
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| C01 - Record Type | 2 | 2 | ‘10’ |
| C02 - Transaction Identifier | 1 | 30 | Código cliente |
| C03 - Company Code | 1 | 15 | ‘’ |
| C04 - Sale Date | 8 | 8 | yyyyMMDD |
| C05 - Summary Number | 1 | 10 | ‘’ |
| C06 - receipt Number | 1 | 12 | ‘’ |
| C07 - SiTef's NSU | 1 | 12 | * |
| C08 - Credit Card Number | 1 | 19 | ‘’ |
| C09 - Gross Value | 3 | 16 | No cent separator Gross Value of the installment, if divided into installments |
| C10 - Total Installments | 2 | 2 | For cash transactions = ‘00’ |
| C11 - Net value | 1 | 16 | No cent separator Value of the installment, if divided into installments. If the value is lower than the value in the column "C12 - Original Net Value", it means that some event has changed the value to be paid. Value=“0”, means total cancellation of the amount to be paid. |
| C12 - Original Net Value | 0 | 16 | No cent separator Original Net Value, if divided into installments. Mainly used to indicate a cancellation by Redecard. onpty if there is no unscheduling. |
| C13 - Credit Date | 8 | 8 | YYYYMMDD |
| C14 - Original Credit Date | 0 | 8 | YYYYMMDD Mainly used to indicate an acceleration of Visa. Empty in case there is no acceleration. |
| C15 - Installment Number | 2 | 2 | Installment Number |
| C16 - Product Type | 1 | 1 | ‘C’ - credit ‘D’ – debit ‘V’ – voucher ‘S’ – withdraw |
| C17 – Capture | 1 | 1 | ‘0’, ‘2’, ‘3’ – SiTef ‘1’, ‘4’, ‘5’ – Others |
| C18 - Network identity code | 1 | 3 | See Table I |
| C19 - Banck Number | 1 | 6 | ‘’ |
| C20 - bank branch Number | 1 | 6 | ‘’ |
| C21 - checking account number | 1 | 15 | ‘’ |
| C22 - commission amount | 3 | 16 | No cent separator |
| C23 - Service Fee Value | 3 | 5 | No cent separator Eg: 199 = 1,99 % |
| C24 - CodLojaSiTef | 8 | 8 | |
| C25 - Authorization Code | 0 | 12 | ** |
| C26 - Invoice | 0 | 20 | Invoice |
| C27 - Credit Card Company Code | 4 | 4 | [See table II](code table) |
| C28 – Sale Date Sitef | 1 | 8 | YYYYMMDD if it doesn't exist ‘’ |
| C29 – Sale Time Sitef | 1 | 6 | HHMMSS if it doesn't exist ‘’ |
| C30 - Sequential number of record in file | 6 | 6 |
* For NON-TEF transactions, this field is filled with the receipt Number information (C06).
** In the case of Redecard Debit, Goodcard and Tecban, this data is not available in electronic statements.
Record 2 – Adjustments
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| A01 - Record Type | 1 | 1 | ‘2’ |
| A02 - Company Code | 1 | 15 | ‘’ |
| A03 - Adjustment Date | 8 | 8 | YYYYMMDD |
| A04 - Adjustment Value | 3 | 16 | No cent separator |
| A05 - Net Adjustment Value | 3 | 16 | No cent separator |
| A06 - Summary Number | 1 | 10 | ‘’ |
| A07 - Credit Card Number | 1 | 19 | ‘’ |
| A08 - Receipt Number | 1 | 12 | ‘’ |
| A09 - Sale Date | 8 | 8 | YYYYMMDD |
| A10 - Adjustment Reason Code | 1 | 15 | ‘’ |
| A11 - Description of Reason for Adjustment | 1 | 64 | ‘’ |
| A12 - Reference number | 1 | 15 | Exclusive Redecard (POS) |
| A13 - Original Summary Number | 1 | 10 | Exclusive Redecard |
| A14 - Reference Month | 6 | 6 | Exclusive Redecard (POS) |
| A15 - network identifier code | 1 | 3 | [See table I](code table) |
| A16 - Bank Number | 6 | 6 | |
| A17 - bank branch Number | 6 | 6 | |
| A18 - checking account number | 1 | 15 | ‘’ |
| A19 - commission amount | 3 | 16 | No cent separator |
| A20 - Service Fee Value | 3 | 16 | No cent separator |
| A21 - Codlojasitef | 8 | 8 | |
| A22 - Sequential number of record in file | 6 | 6 |
Record 100 – Anticipation Batch
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| L01 - Record Type | 3 | 3 | ‘100’ |
| L02 - Company Code | 1 | 15 | ‘’ |
| L03 - CodLojaSiTef | 8 | 8 | |
| L04 - Summary Number | 1 | 10 | ‘’ |
| L05 - Advance Credit Date | 8 | 8 | YYYYMMDD |
| L06 - Amount paid | 3 | 16 | No cent separator. Net amount paid. |
| L07 - network identifier code | 1 | 3 | [See Table I](code table) |
| L08 - Installment | 2 | 2 | For batch with cash transactions = ‘00’ |
| L09 - Original Credit Date | 8 | 8 | YYYYMMDD |
| L10 - Original Net Value | 3 | 16 | No cent separator. Net value before anticipation. |
| L11 – Gross Value | 3 | 16 | No cent separator. Gross Value of the Anticipation. |
| L12 - Bank Number | 1 | 6 | ‘’ |
| L13 - bank branch Number | 1 | 6 | ‘’ |
| L14 - checking account number | 1 | 15 | ‘’ |
| L15 - File Record Sequential | 6 | 6 |
Record 200 – Anticipated Transactions
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| TA01 - Record Type | 3 | 3 | ‘200’ |
| TA02 - Transaction Identifier | 1 | 30 | Custommer Code |
| TA03 - Company Code | 1 | 15 | ‘’ |
| TA04 - Sale Date | 8 | 8 | YYYYMMDD |
| TA05 - Summary Number | 1 | 10 | ‘’ |
| TA06 - Receipt Number | 1 | 12 | ‘’ |
| TA07 - SiTef's NSU | 1 | 12 | * |
| TA08 - Credit Card Number | 1 | 19 | ‘’ |
| TA09 - Gross Value | 3 | 16 | No cent separator Gross Value of the transaction |
| TA10 - total installments | 2 | 2 | For cash transactions = “00” |
| TA11 - Product Type | 1 | 1 | ‘C’ - credit ‘D’ – debit ‘V’ – voucher ‘S’ – withdraw |
| TA12 - Capture | 1 | 1 | ‘0’, ‘2’, ‘3’ – SiTef ‘1’, ‘4’ , ‘5’ – Others |
| TA13 - network identifier code | 1 | 3 | [See table I](code table) |
| TA14 - CodLojaSiTef | 8 | 8 | |
| TA15 - Authorization Code | 0 | 12 | ** |
| TA16 - Invoice | 0 | 20 | Invoice |
| TA17 - Credit Card Company Code | 4 | 4 | [See table II](code table) |
| TA18 - Sale Date Sitef | 1 | 8 | YYYYMMDD if it doesn't exist ‘’ |
| TA19 - Sale Time Sitef | 1 | 6 | HHMMSS if it doesn't exist ‘’ |
| TA20 - Seq. do Record no Arquivo | 6 | 6 |
* For NON-TEF transactions, this field is filled with the information on the Receipt Number (TA06).
** In the case of Redecard Débito, Goodcard and Tecban, this data is not available in electronic statements.
Record 9 – Trailer
| Field Name | Minimum size | Maximum size | Informations |
|---|---|---|---|
| T01 - Record Type | 1 | 1 | ‘9’ |
| T02 - Sequential number of record in file | 6 | 6 |
5. Remark
- Limitations
- Due to limitations of the data sent by the administrators, the Amex, Visa and Redecard have their projected installments.
-
template for saving to database
- 1st step is to create 3 tables for each record, Sale, Credit and Adjustments, with their respective
columns. - Examples for Oracle:
- 1st step is to create 3 tables for each record, Sale, Credit and Adjustments, with their respective
CREATE TABLE tab_venda
(
tipo_Record VARCHAR2 (01) NULL,
id_cliente VARCHAR2 (30) NULL,
cod_estab VARCHAR2 (15) NULL,
data_venda VARCHAR2 (08) NULL,
num_resumo VARCHAR2 (10) NULL,
num_comprovante VARCHAR2 (12) NULL,
nsu_sitef VARCHAR2 (12) NULL,
num_cartao VARCHAR2 (19) NULL,
valor_bruto VARCHAR2 (16) NULL,
total_parcelas VARCHAR2 (02) NULL,
valor_liquido VARCHAR2 (16) NULL,
data_credito VARCHAR2 (08) NULL,
num_parcelas VARCHAR2 (02) NULL,
tipo_produto VARCHAR2 (01) NULL,
captura VARCHAR2 (01) NULL,
idt_rede VARCHAR2 (03) NULL,
cod_banco VARCHAR2 (06) NULL,
cod_agencia VARCHAR2 (06) NULL,
num_conta VARCHAR2 (15) NULL,
valor_comissao VARCHAR2 (16) NULL,
taxa_servico VARCHAR2 (05) NULL,
codigo_loja VARCHAR2 (08) NULL,
codigo_autoriz VARCHAR2 (12) NULL,
cupom_fiscal VARCHAR2 (20) NULL,
codigo_bandeira VARCHAR2 ( 0 4) NULL,
data_venda_sitef VARCHAR2 ( 08 ) NULL,
hora_venda_sitef VARCHAR2 ( 06 ) NULL,
seq VARCHAR2 (06) NULL
);
CREATE TABLE tab_credito
(
tipo_Record VARCHAR2 (0 2 ) NULL,
id_cliente VARCHAR2 (30) NULL,
cod_estab VARCHAR2 (15) NULL,
data_venda VARCHAR2 (08) NULL,
num_resumo VARCHAR2 (10) NULL,
num_comprovante VARCHAR2 (12) NULL,
nsu_sitef VARCHAR2 (12) NULL,
num_cartao VARCHAR2 (19) NULL,
valor_bruto VARCHAR2 (16) NULL,
total_parcelas VARCHAR2 (02) NULL,
valor_liquido VARCHAR2 (16) NULL,
valor_liquido_orig VARCHAR2 (16) NULL,
data_credito VARCHAR2 (08) NULL,
data_credito_orig VARCHAR2 (08) NULL,
num_parcelas VARCHAR2 (02) NULL,
tipo_produto VARCHAR2 (01) NULL,
captura VARCHAR2 (01) NULL,
idt_rede VARCHAR2 (03) NULL,
cod_banco VARCHAR2 (06) NULL,
cod_agencia VARCHAR2 (06) NULL,
num_conta VARCHAR2 (15) NULL,
valor_comissao VARCHAR2 (16) NULL,
taxa_servico VARCHAR2 (05) NULL,
codigo_loja VARCHAR2 (08) NULL,
codigo_autoriz VARCHAR2 (12) NULL,
cupom_fiscal VARCHAR2 (20) NULL,
codigo_bandeira VARCHAR2 ( 0 4) NULL,
data_venda_sitef VARCHAR2 ( 08 ) NULL,
hora_venda_sitef VARCHAR2 ( 06 ) NULL,
seq VARCHAR2 (06) NULL
);
CREATE TABLE tab_ajuste
(
tipo_Record VARCHAR2 (01) NULL,
cod_estab VARCHAR2 (15) NULL,
data_ajuste VARCHAR2 (08) NULL,
valor_ajuste VARCHAR2 (16) NULL,
valor_liquido_ajuste VARCHAR2 (16) NULL,
num_resumo VARCHAR2 (10) NULL,
num_cartao VARCHAR2 (19) NULL,
num_comprovante VARCHAR2 (12) NULL,
data_venda VARCHAR2 (08) NULL,
cod_ajuste VARCHAR2 (15) NULL,
descrição_ajuste VARCHAR2 ( 64 ) NULL,
num_referencia VARCHAR2 (1 5 ) NULL,
num_resumo_orig VARCHAR2 (1 0 ) NULL,
mês_referencia VARCHAR2 (0 6 ) NULL,
idt_rede VARCHAR2 (03) NULL,
cod_banco VARCHAR2 (06) NULL,
cod_agencia VARCHAR2 (06) NULL,
num_conta VARCHAR2 (15) NULL,
valor_comissao VARCHAR2 (16) NULL,
taxa_servico VARCHAR2 (05) NULL,
codigo_loja VARCHAR2 (08) NULL,
seq VARCHAR2 ( 0 6) NULL
);
CREATE TABLE tab_lote_antec
(
tipo_Record VARCHAR2 (03) NULL,
cod_estab VARCHAR2 (15) NULL,
codigo_loja VARCHAR2 (08) NULL,
num_resumo VARCHAR2 (10) NULL,
data_credito_antec VARCHAR2 (08) NULL,
valor_pago VARCHAR2 (16) NULL,
idt_rede VARCHAR2 (03) NULL,
num_parcela VARCHAR2 (02) NULL,
data_credito_orig VARCHAR2 (08) NULL,
valor_liquido_orig VARCHAR2 (16) NULL,
valor_bruto VARCHAR2 (16) NULL,
cod_banco VARCHAR2 (06) NULL,
cod_agencia VARCHAR2 (06) NULL,
num_conta VARCHAR2 (15) NULL,
seq VARCHAR2 (06) NULL
);
CREATE TABLE tab_trn_antec
(
tipo_Record VARCHAR2 (0 3 ) NULL,
id_cliente VARCHAR2 (30) NULL,
cod_estab VARCHAR2 (15) NULL,
data_venda VARCHAR2 (08) NULL,
num_resumo VARCHAR2 (10) NULL,
num_comprovante VARCHAR2 (12) NULL,
nsu_sitef VARCHAR2 (12) NULL,
num_cartao VARCHAR2 (19) NULL,
valor_bruto VARCHAR2 (16) NULL,
total_parcelas VARCHAR2 (02) NULL,
tipo_produto VARCHAR2 (01) NULL,
captura VARCHAR2 (01) NULL,
idt_rede VARCHAR2 (03) NULL,
codigo_loja VARCHAR2 (08) NULL,
codigo_autoriz VARCHAR2 (12) NULL,
cupom_fiscal VARCHAR2 (20) NULL,
codigo_bandeira VARCHAR2 ( 0 4) NULL,
data_venda_sitef VARCHAR2 ( 08 ) NULL,
hora_venda_sitef VARCHAR2 ( 06 ) NULL,
seq VARCHAR2 (06) NULL
);
Updated 23 days ago