Skip to main content

Assignment Batch Creation

This is the first step of the credit rights assignment flow. Creating the batch (assignment) reserves a grouping into which the assets to be assigned to the fund are inserted in the following steps.

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

Base URL for each host: Environments (Hosts).

Prerequisites

Before creating a batch, you need:

These two keys make up the path of every assignment endpoint:

/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}

Request​

ENDPOINT
/trade_receivables/fund_class/{fund_class_key}/assignment_configuration/{assignment_configuration_key}/assignment
METHOD
POST
Request Body
{
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"assignment_date": "2024-04-01"
}

Body attributes​

FieldTypeRequiredDescription
external_idstringrequiredBatch identifier in your system, from 1 to 50 characters. It is unique across the whole platform, not only within the fund: use a UUID. It is how you query the batch and how webhooks identify it.
assignment_datestringoptionalAssignment date, in YYYY-MM-DD format. It cannot be earlier than the fund's current accounting date. If omitted, the current accounting date applies. With a future date, the batch stays in waiting_assignment_date after insertion is closed and only enters the pipeline on that date.
payment_typestringoptionalPayment method to the assignor: pix or wire_transfer. If omitted, the method defined in the assignment configuration applies.
disbursementobjectoptionalDisbursement account specific to this batch, in the target_account field (see below). If omitted, the account is defined at approval. Refused when the assignment contract fixes a single disbursement account.
assignor_discountsarrayoptionalAssignor discounts, deducted from the assignment payment. Accepted only when the assignment configuration allows discounts (see below).
assignment_numbernumberoptionalBatch number. If omitted, QI Tech generates one.

disbursement.target_account attributes​

FieldTypeRequiredDescription
account_branchstringrequiredBranch, with 4 digits.
account_numberstringrequiredAccount number, without the check digit.
account_digitstringrequiredAccount check digit (1 character).
account_typestringrequiredchecking_account or escrow_account.
financial_institution_ispbstringrequiredInstitution ISPB, with 8 digits.
financial_institution_codestringoptionalInstitution COMPE code, with 3 digits.
owner.document_numberstringrequiredHolder's CPF or CNPJ, with punctuation.

Attributes of each assignor_discounts item​

FieldTypeRequiredDescription
assignor_discount_typestringrequiredexpense_reimbursement (expense reimbursement) or others.
total_valuenumberrequiredDiscount amount, in reais. Minimum 0.01.
descriptionstringrequiredDiscount description, from 1 to 500 characters.
assignor_discount_keystringoptionalUUID v4 of the discount. If omitted, QI Tech generates one.

Response​

STATUS
201
Response Body
{
"assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"status": "pending_assets_insertion"
}

Response attributes​

FieldTypeDescription
assignment_keystringUnique batch identifier generated by QI Tech (UUID).
external_idstringThe same external key provided in the request.
statusstringInitial batch status: pending_assets_insertion, ready to receive assets.

Retry and duplicates​

On error, resend the request. A duplicate (TRC000041) means the batch already exists: query it through Batch Retrieval instead of creating it again. See Retry and duplicates.

Errors​

StatusCodeWhen it happens
400TRC000014The assignment configuration is not active.
400TRC000083assignment_date is earlier than the fund's current accounting date. Omit the field or send the current accounting date.
400TRC000136assignor_discounts were sent, but the assignment configuration does not allow assignor discounts.
400TRC000185disbursement was sent, but the assignment contract fixes a single disbursement account.
404TRC000016The combination of fund_class_key and assignment_configuration_key does not match any assignment configuration.
409TRC000041A batch with this external_id already exists. See Retry and duplicates.
422TRC000161The configuration requires asset registration, but has no registry chamber configured. Contact the integration team.

Authentication, permission and host errors: see API Errors.

Next steps​

  1. Asset insertion — add the assets (CCBs, duplicatas, etc.) to be assigned to the fund.
  2. Document upload — upload the required documentation for each asset.
  3. Insertion closing — signal that all assets have been inserted so the batch moves on to the eligibility analysis.