Skip to main content

Asset Creation — Invoice (Duplicata)

Endpoint to insert a Invoice asset into an assignment batch. There are two accepted subtypes: Commercial Invoice (duplicata_mercantil) — linked to a merchandise sales invoice — and Service Invoice (duplicata_servicos) — linked to a service provision invoice.

Difference between types

Both types use the same request body structure. The main difference is that commercial invoices do not require document submission after eligibility, while service invoices do. See the Document Insertion page for more details.

Where am I in the flow?

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

Attention

The external_id field of the credit right must be unique for each asset and must not be confused with the external_id of the batch.

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": "duplicata_mercantil",
"total_purchase_value": 1231.21,
"discounted_credit_right": {
"external_id": "ccf6f331-d55f-46c0-a32f-fb909884dbb2",
"originator_document_number": "46.282.154/0001-14",
"maturity_date": "2023-12-10",
"order_number": "18923619954796912",
"face_value": 1023.01,
"person_type": "natural_person",
"borrower": {
"name": "Natália Nascimento",
"document_number": "805.359.140-08",
"person_type": "natural_person",
"email": "natalia.nascimento@yopmail.com",
"address": {
"street": "Gilberto Sabino",
"number": "215",
"neighborhood": "Pinheiros",
"city": "São Paulo",
"postal_code": "05425-020",
"uf": "SP",
"country": "BRA"
},
"phone": {
"area_code": "11",
"number": "36360268"
},
"natural_person": {
"mother_name": "Lívia Santos",
"birthdate": "2001-01-05"
}
},
"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": "69037229347091328617032722238810300308237163",
"total_value": 1231.21,
"serie": "123",
"number": "958431587",
"issue_date": "2023-10-10"
}
}
}

Body attributes

FieldTypeRequiredDescription
asset_typestringrequiredAsset type. Accepted values: duplicata_mercantil or duplicata_servicos.
total_purchase_valuenumberrequiredTotal asset purchase value — the effective amount 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 identifier for this asset in the partner's system. Maximum 50 characters.
originator_document_numberstringrequiredFormatted CPF or CNPJ of the originator/consultant who facilitated the operation.
maturity_datestringrequiredMaturity date in YYYY-MM-DD format.
order_numberstringrequiredOrder number. Maximum 45 characters.
face_valuenumberrequiredFace value. Up to 8 decimal places.
person_typestringoptionalBorrower person type (natural_person or legal_person).
borrowerobjectrequiredBorrower data. See borrower attributes on the CCB Asset Creation page.
participant_control_numberstringoptionalParticipant control number in the partner's system. Maximum 50 alphanumeric characters.
bankslipobjectoptionalBank slip data. See bankslip attributes.
delayobjectoptionalLate fine and interest data. See delay attributes on the CCB Asset Creation page.
invoiceobjectrequiredInvoice data. See invoice attributes.

bankslip attributes

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

our_number attributes

FieldTypeRequiredDescription
numbernumberrequiredOur number. Bank collection number with registration. 1 to 11 numeric characters.
digitstringrequiredCheck digit for our number self-verification. 1 alphanumeric character.

invoice attributes

FieldTypeRequiredDescription
access_keystringrequiredInvoice access key. 44 characters.
total_valuenumberoptionalTotal invoice value. Up to 2 decimal places.
seriestringrequiredInvoice series number. Maximum 3 characters.
numberstringrequiredInvoice number. Maximum 50 characters.
issue_datestringrequiredIssue date in YYYY-MM-DD format.

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. Always returns pending_eligibility, indicating the asset was inserted and awaits eligibility analysis.

Possible errors

STATUS
404
Batch not found
{
"title": "Assignment not found",
"description": "Assignment not found",
"translation": "Lote não encontrado",
"code": "TRC000018"
}
STATUS
404
Asset type does not exist
{
"title": "Asset type does not exist",
"description": "Asset type 'invalid_asset_type' does not exist",
"translation": "Tipo do ativo 'invalid_asset_type' nao existe",
"code": "TRC000015"
}
STATUS
400
Asset type incompatible with batch
{
"title": "Invalid asset type configuration",
"description": "This assignment can not receive this asset type: duplicata_mercantil",
"translation": "Esse lote não pode receber esse tipo de ativo: duplicata_mercantil",
"code": "TRC000025"
}
STATUS
400
Batch closed for insertion
{
"title": "Assignment is closed",
"description": "Assignment is closed to insert new assets",
"translation": "Lote esta fechado para inserir novos ativos",
"code": "TRC000022"
}
STATUS
400
Duplicate external_id
{
"title": "Already Exist This External Id",
"description": "Already exist an asset with this External Id",
"translation": "Ja existe um ativo com esse External Id",
"code": "TRC000054"
}

Next steps

After inserting the asset, the flow continues with:

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