Skip to main content

CSV layout — discounted contracts

Spreadsheet for the assignment of discounted contracts (discounted_contract). Unlike the installment contract, here each line is an asset: one installment of a contract, assigned and settled on its own. Lines with the same contract_number are installments of the same contract, and you can assign only some of them.

Where this file is used

In the flow described in Assignment by file. Discounted contracts can also be submitted through CNAB 400, 444 and 500 with species 60 or 61, but in CNAB the total value and the number of installments of the contract are calculated only from the lines in the file. To assign through the API, see Asset creation — discounted contract.

Download the CSV example

Step by step​

  1. Write one line per assigned installment, each with its own external_id.
  2. In the installments of the same contract, repeat the number, the issue date, the total face value, the number of installments and the drawee's document.
  3. In installment_number, state which installment of the contract the line is.
  4. Save as CSV in UTF-8 and submit it with the .csv extension.

File format​

ItemRule
HeaderThe first line, with the exact column names, in lowercase
LinesOne per assigned installment. Each line is an asset
SeparatorComma or semicolon, detected from the header
EncodingUTF-8, with or without BOM
ValuesDot as the decimal separator, up to 8 decimal places, no thousands separator
DatesYYYY-MM-DD
DocumentsCPF 000.000.000-00 and CNPJ 00.000.000/0000-00, with the punctuation

Columns​

ColumnRequirementFormat and use
asset_typeRequireddiscounted_contract
external_idRequiredUp to 50 characters. Identifier of the assigned installment, unique in the file. It is the identifier used for settlement
originator_document_numberRequiredCPF or CNPJ of the originator, registered and linked to the configuration. The same on every line
contract_numberRequiredUp to 50 characters. Groups the installments of the same contract
contract_issue_dateRequiredIssue date of the contract. The same in the installments of the contract
contract_total_face_valueRequiredFace value of the whole contract, including the installments that are not in the file. The same in the installments of the contract
contract_number_of_installmentsRequiredTotal number of installments of the contract, an integer starting at 1. The same in the installments of the contract
installment_numberRequiredNumber of this installment, from 1 to contract_number_of_installments. Not repeated within the same contract
maturity_dateRequiredDue date of the installment
face_valueRequiredFace value of the installment
total_purchase_valueRequiredHow much the fund pays for the installment
borrower_nameRequiredUp to 255 characters
borrower_document_numberRequiredCPF or CNPJ with punctuation and a valid check digit. The same in the installments of the contract
borrower_person_typeRequirednatural_person or legal_person
borrower_address_postal_codeRequiredCEP 00000-000
borrower_emailOptionalUp to 255 characters
borrower_address_street, _number, _neighborhood, _city, _uf, _countryOptionalAs in the receivables CSV
borrower_phone_area_codeConditional2-digit area code. Required if the number is filled in
borrower_phone_numberConditional8 or 9 digits. Required if the area code is filled in

File rules​

All of these reject the whole file:

  • external_id repeated in the file.
  • installment_number greater than contract_number_of_installments.
  • The same installment (installment_number) twice in the same contract.
  • Installments of the same contract_number with different contract_issue_date, contract_total_face_value, contract_number_of_installments or borrower_document_number.
  • Different originators across lines, or an originator not linked to the configuration.
  • Any column out of format.

These reject only the installment, at registration: a receivable already past due on the assignment date (TRC100017), an invalid document (TRC000009) or half a phone number.

Face value and purchase value

The spreadsheet does not check whether face_value is greater than total_purchase_value. Check it before submitting: the installment validation at registration may reject it.

Example​

Installments 2 and 3 of a three-installment contract. Installment 1 is not assigned.

cessao_contrato_descontado.csv
asset_type,external_id,originator_document_number,contract_number,contract_issue_date,contract_total_face_value,contract_number_of_installments,installment_number,maturity_date,face_value,total_purchase_value,borrower_name,borrower_document_number,borrower_person_type,borrower_address_postal_code
discounted_contract,CD-0001-01,11.222.333/0001-81,CD-0001,2026-10-01,3000.00,3,2,2026-12-10,1000.00,970.00,Joao da Silva,111.444.777-35,natural_person,01311-000
discounted_contract,CD-0001-02,11.222.333/0001-81,CD-0001,2026-10-01,3000.00,3,3,2027-01-10,1000.00,955.00,Joao da Silva,111.444.777-35,natural_person,01311-000

Errors​

MessageHow to fix
The identifier '…' is duplicated. Each installment must have a unique identifier.One external_id per line
Installment N is greater than the number of installments of the contract (M).Fix installment_number or contract_number_of_installments
Installment N of the contract '…' is repeated in the file.Keep each installment only once
All installments of the contract '…' must have the same …, but '…' and '…' were received.Make the issue date, total value, number of installments and drawee equal across the installments
The field … must be a valid CPF (000.000.000-00) or CNPJ (00.000.000/0000-00).Use the document with punctuation