Skip to main content

CSV layout — settlement

Spreadsheet for settling portfolio assets: one line per settlement, for any asset type. It is the only settlement file that accepts gloss, fine and refund.

Where this file is used

In the flow described in Settlement by file. The spreadsheet must have the .csv extension.

Download the example CSV

Step by step​

  1. Choose how to identify the assets for the whole file: by the asset identifier (external_id) or by the contract number (contract_number). Put only the chosen column in the header.
  2. Build the header with asset_type, total_value, settlement_type, installment_number and the identification column. Add the optional columns that all lines will use.
  3. Write one line per settlement, with a settlement type allowed for the asset type (table).
  4. Save it as CSV in UTF-8, with no spaces around the values.

File format​

ItemRule
HeaderThe first line, with lowercase names. Unknown columns are ignored
Separator; or ,, detected from the header. With ,, use a decimal point or put the value in quotes
EncodingUTF-8, with or without BOM. Characters in another encoding are dropped without warning, and an identifier with an accent is no longer found
Amounts. or , as decimal separator, no thousands separator (1.250,40 is rejected) and at most 2 decimal places
DatesAAAA-MM-DD (YYYY-MM-DD)
SpacesValues are not trimmed: " ccb" is different from ccb
SizeUp to 850,000 lines. Empty lines are skipped, but count in the numbering

Columns​

ColumnRequirementFormat and use
asset_typeRequiredAsset type, the same as registered in the portfolio. See Asset types
total_valueRequiredSettlement amount, positive, up to 2 decimal places. Zero only in the types that accept it (see the table)
settlement_typeRequiredSettlement type. See Settlement types
installment_numberColumn required; value conditionalInstallment number, an integer starting at 1. Required in installment settlement types, unless the line uses installment_external_id. Empty in settlements of the whole asset
external_idConditionalAsset identifier, up to 36 characters. Required when the file identifies by asset. Required for extension
contract_numberConditionalContract number, up to 36 characters. Required when the file identifies by contract
installment_external_idOptionalInstallment identifier, an alternative to installment_number. If the column is in the header, fill it in on every line
collection_origin_typeOptionalWho paid: borrower (drawee), assignor (assignor) or collection_agent (collection agent). If the column is in the header, fill it in on every line
new_maturity_dateConditionalNew maturity date. Required in asset_extension and forbidden in the other types
remaining_face_valueOptionalFace value balance that remains in the installment. Only in installment_amortization and never for contracts
Identification applies to the whole file

The file identifies assets by external_id or by contract_number. If both columns are in the header, contract_number applies to every line and external_id is ignored. With neither, the file is rejected. To mix them, send two files.

Who paid (collection_origin_type)​

  • Without the column, the origin is the one in the fund's settlement configuration, if any.
  • With the column, each line's value prevails.
  • collection_agent requires the fund's settlement configuration to have a default collection agent document. Without it, the line is rejected with SET000078.

Asset types​

Groupasset_type
Credit operationsccb, cce, structured_ccb, structured_cce, structured_nce, structured_cci
Credit rightsduplicata_mercantil, duplicata_servicos, cte, check, promissory_note, discounted_contract, legal_fees, credit_card_bill, receivable_unit, private_label_credit_card_receivable
Securitiescommercial_paper
Contractscontract, financing_contract, debt_acknowledgment

Settlement types​

settlement_typeWhat it doesCredit operations and securitiesCredit rightsContractsInstallmenttotal_value
asset_settlementFull settlement of the assetYesYesYesNoZero or more
asset_amortizationPartial payment of the assetYesYesYesNoGreater than zero
installment_settlementSettlement of the installmentYesNoYesRequiredZero or more
installment_amortizationPartial payment of the installmentYesNoYesRequiredGreater than zero
glossGloss: write-off of the installment without paymentYesNoNoRequiredGreater than zero
asset_extensionMaturity extensionNoYes, by external_idNoNoZero or more
installment_fine_paymentPayment of the installment fineYesNoNoRequiredGreater than zero
installment_partial_refundPartial refund of the installmentYesNoNoRequiredGreater than zero
  • "Installment required" means: fill in one and only one of installment_number and installment_external_id.
  • For contracts, only the first four types are accepted. The others reject the file.
  • For gloss, provide a positive amount: the system records it as an outflow.

File rules​

These reject the whole file (file reading):

  • Required column missing from the header (missing_fields).
  • asset_type, settlement_type, total_value, installment_number or new_maturity_date in the wrong format.
  • Empty identifier in the chosen column.
  • collection_origin_type column present with an empty line or a value outside the list.
  • new_maturity_date missing in an extension, or present in another type.
  • remaining_face_value outside installment_amortization, or for a contract.
  • For contracts: settlement type outside the four accepted ones, installment missing in installment types, installment provided in both columns at once, or installment_number less than 1.

These reject only the line (validation against the portfolio): asset not found, repeated settlement in the batch, payment already made on the same date and the other reasons listed in Settlement by file.

Examples​

Identification by asset, separated by ;:

baixa_por_ativo.csv
asset_type;total_value;settlement_type;external_id;installment_number;collection_origin_type;new_maturity_date
ccb;1250,40;installment_settlement;CCB-7781;3;borrower;
duplicata_mercantil;2500,00;asset_settlement;DM-000123;;assignor;
duplicata_mercantil;0;asset_extension;DM-000125;;borrower;2027-01-15
LineReading
1Pays installment 3 of the CCB CCB-7781, by the drawee
2Repurchase of the duplicata DM-000123, paid by the assignor
3Extends the maturity of the duplicata DM-000125 to 01/15/2027

Identification by contract:

baixa_por_contrato.csv
asset_type;total_value;settlement_type;contract_number;installment_number;collection_origin_type
contract;2500,00;installment_settlement;CT-000104;2;borrower
financing_contract;10000,00;asset_amortization;FM-000210;;assignor

With , as the separator, use a decimal point: ccb,1250.40,installment_settlement,CCB-7781,3,borrower,.

Errors​

MessageHow to fix
missing_fields: [...]Include the required columns and external_id or contract_number
malformed csv unable to readSave it as CSV, separated by ; or ,
invalid asset_type: …Use a type from the table, with no surrounding spaces
invalid total_value: …Amount without a thousands separator
invalid settlement_type: …Use a type from the table
invalid external_id: / invalid contract_number: Fill in the identifier on every line
invalid collection_origin_type: …Fill in the origin on every line, or remove the column
new_maturity_date is required for settlement_type asset_extensionProvide the new date for the extension
new_maturity_date is only allowed for settlement_type asset_extension, not: …Leave the date empty in the other types
remaining_face_value is only allowed for settlement_type installment_amortization, not: …Use the balance only in the partial payment of an installment
settlement_type … is not allowed for contracts, only: [...]For contracts, use settlement or partial payment, of the asset or the installment
inform only one of installment_number or installment_external_id for contractsFill in only one of the two columns
Number of lines exceeded maximum allowedSplit the file into batches of up to 850,000 lines