Skip to main content

Asset Creation — CTE

Endpoint to insert a CTE (Conhecimento de Transporte Eletrônico — Electronic Bill of Lading) asset into an assignment batch. The CTE is an electronic tax document that proves the provision of a transport service, used as the credit right in the assignment operation.

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiBatches
Assignorassignor-apiWrite

Base URL for each host: Environments (Hosts).

Where am I in the flow?

This is step 2 of the assignment flow. Before this, you must have created the batch. After inserting the assets, submit the required documents and close the insertion.

Attention

The external_id field of the credit right identifies the asset within the batch and must not be confused with the batch external_id.

Request​

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment/{assignment_external_id}/asset
METHOD
POST
Request Body
{
"asset_type": "cte",
"total_purchase_value": 1231.21,
"discounted_credit_right": {
"external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
"originator_document_number": "22.333.444/0001-81",
"maturity_date": "2023-12-10",
"order_number": "18923619954796912",
"face_value": 1023.01,
"person_type": "legal_person",
"borrower": {
"name": "Transportadora Exemplo Ltda",
"document_number": "11.222.333/0001-81",
"person_type": "legal_person",
"email": "contato@transportadora.com.br",
"address": {
"street": "Avenida Paulista",
"number": "1000",
"neighborhood": "Bela Vista",
"city": "São Paulo",
"postal_code": "01310-100",
"uf": "SP",
"country": "BRA"
},
"phone": {
"area_code": "11",
"number": "936360268"
},
"legal_person": {
"activity_code": "49.30-2-01"
}
},
"participant_control_number": "ICX841HWCPUGU4U101XPLDW8D",
"bankslip": {
"our_number": {
"number": 2,
"digit": "P"
}
},
"delay": {
"fine": {
"fine_type": "percentage",
"percentage_value": 0.0
},
"interest": {
"method": "pre_fixed",
"pre_fixed": {
"daily_rate": 0.0,
"calendar_base": "calendar_360"
}
}
},
"invoice": {
"access_key": "35231011222333000181570010000000011892361995",
"total_value": 1231.21,
"serie": "001",
"number": "958431587",
"issue_date": "2023-10-10"
}
}
}

Body attributes​

FieldTypeRequiredDescription
asset_typestringrequiredAsset type. For CTE, provide cte.
total_purchase_valuenumberrequiredTotal purchase value of the asset — effectively how much the assignee will pay. Up to 2 decimal places.
discounted_credit_rightobjectrequiredCredit right data. See discounted_credit_right attributes.

discounted_credit_right attributes​

FieldTypeRequiredDescription
external_idstringrequiredUnique identification key of this asset in the partner's system. Maximum of 50 characters.
originator_document_numberstringrequiredFormatted CPF or CNPJ (000.000.000-00 or 00.000.000/0000-00) of the originator that enabled the operation. It must be registered with QI Tech; otherwise, it returns TRC000019.
maturity_datestringrequiredMaturity date in the YYYY-MM-DD format.
order_numberstringrequiredOrder number. Maximum of 45 characters. Without it, the insertion returns TRC000078.
face_valuenumberrequiredFace value. Up to 8 decimal places.
person_typestringoptionalDrawee person type (natural_person or legal_person).
borrowerobjectrequiredDrawee data. See the borrower attributes on the Asset Creation — CCB page.
invoiceobjectrequiredCT-e data. See invoice attributes. Without it, the insertion returns TRC000075. Do not send the contract object for this asset type (TRC000076).
participant_control_numberstringoptionalParticipant control number in the partner's system. Maximum of 25 alphanumeric characters.
bankslipobjectoptionalBankslip data. See bankslip attributes.
delayobjectoptionalLate fine and interest data. See delay attributes.

invoice attributes​

FieldTypeRequiredDescription
access_keystringrequiredCT-e access key. 44 characters. Positions 21 and 22 of the key must be the document model (57 or 67).
total_valuenumberoptionalTotal CT-e value. Up to 2 decimal places.
seriestringrequiredCT-e series number. Maximum of 3 characters.
numberstringrequiredCT-e number. Maximum of 9 characters.
issue_datestringrequiredIssue date in the YYYY-MM-DD format.

bankslip attributes​

FieldTypeRequiredDescription
our_numberobjectoptionalOur number data. Applicable only when the our number is issued by the client. See our_number attributes.

our_number attributes​

FieldTypeRequiredDescription
numbernumberrequiredOur number. Bank number for registered collection. 1 to 11 numeric characters.
digitstringrequiredSelf-verification check digit of the our number. 1 alphanumeric character.

delay attributes​

FieldTypeRequiredDescription
fineobjectrequiredLate fine data. See fine attributes.
interestobjectrequiredLate interest data. See interest attributes.

When sending delay, provide fine and interest. This object applies to all credit rights (duplicatas and CT-e).

fine attributes​

FieldTypeRequiredDescription
fine_typestringrequiredFine type.
percentage_valuenumberconditionalFine value when fine_type is percentage. From 0 to 1, representing 0% to 100%. Up to 2 decimal places.
amountnumberconditionalFixed fine value when fine_type is fixed. Up to 2 decimal places.

fine_type enumerators:

ValueDescription
percentagePercentage fine on the installment value.
fixedFixed fine value.

interest attributes​

FieldTypeRequiredDescription
methodstringrequiredLate interest method.
pre_fixedobjectrequiredFixed-rate data. See pre_fixed attributes.

method enumerators:

ValueDescription
compoundCompound late interest.
simpleSimple late interest.
pre_fixedFixed-rate late interest.

pre_fixed attributes​

FieldTypeRequiredDescription
daily_ratenumberconditionalDaily rate. For 1%, provide 0.01. Provide daily_rate or monthly_rate.
monthly_ratenumberconditionalMonthly rate. For 1%, provide 0.01. Provide daily_rate or monthly_rate.
calendar_basestringrequiredCalculation base used.

calendar_base enumerators:

ValueDescription
workdaysCalculation base in business days (252).
calendar_365Calculation base of 365 days.
calendar_360Calculation base of 360 days.

Response​

STATUS
201
Response Body
{
"asset_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
"status": "pending_eligibility"
}

Response attributes​

FieldTypeDescription
asset_keystringUnique asset identifier generated by QI Tech (UUID).
external_idstringThe same external key provided in the external_id field of discounted_credit_right.
statusstringInitial asset status. It always returns pending_eligibility, indicating that the asset was inserted and is awaiting eligibility analysis.

Errors​

StatusCodeWhen it happens
400QIT000001The request body does not follow the expected format: missing required field, invalid type or format. The description points to the field.
404TRC000018There is no batch with that assignment_external_id in this assignment configuration.
400TRC000025The asset_type differs from the asset type of the assignment configuration.
400TRC000022The batch no longer accepts assets: the insertion has already been closed. To add more, reopen the batch.
400TRC000009Invalid CPF or CNPJ in originator_document_number or in the document_number of a natural person drawee.
404TRC000019There is no originator registered with the originator_document_number provided. Despite the title (Originator bond not found), the error does not refer to the link with the configuration.
400TRC000078Missing order_number.
400TRC000075Missing invoice object.
400TRC000076contract object sent in a CT-e.
400TRC000134Missing invoice.access_key.
400TRC000133invoice.access_key is not from a CT-e (model 57 or 67 in positions 21 and 22).
409TRC000054An asset with that external_id already exists in this batch.
409TRC100026A credit right with that external_id already exists for the same assignor in the fund's portfolio.
400TRC1000xxThe asset's financial validation refused the request body. Example: TRC100017 (409), the fund does not buy overdue assets.

The error body follows the format below:

{
"title": "Already Exist This External Id",
"description": "Already exist an asset with this External Id and asset_key->41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"translation": "Ja existe um ativo com esse External Id e asset_key->41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"code": "TRC000054"
}

In case of error, resend the request. A duplicate (TRC000054) means the resource already exists: query it instead of recreating it, through the asset query endpoint. More in Retry and duplicates.

Authentication, permission and host errors: see API Errors.

Next steps​

After inserting the asset, the flow continues with:

  1. Document submission — submit the required documentation for each asset approved in eligibility.
  2. Close asset insertion — signal that all assets have been inserted so the batch proceeds to the eligibility analysis.