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
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
Prerequisites
Before creating a batch, you need:
- The
fund_class_key— unique key of the assignee fund. - The
assignment_configuration_key— unique key of the assignment configuration, obtained in Assignor Onboarding or in Assignment Configuration Listing. The configuration must have statusactive.
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}/assignmentMETHOD
POSTRequest Body
{
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"assignment_date": "2024-04-01"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | required | Batch 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_date | string | optional | Assignment 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_type | string | optional | Payment method to the assignor: pix or wire_transfer. If omitted, the method defined in the assignment configuration applies. |
disbursement | object | optional | Disbursement 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_discounts | array | optional | Assignor discounts, deducted from the assignment payment. Accepted only when the assignment configuration allows discounts (see below). |
assignment_number | number | optional | Batch number. If omitted, QI Tech generates one. |
disbursement.target_account attributes
| Field | Type | Required | Description |
|---|---|---|---|
account_branch | string | required | Branch, with 4 digits. |
account_number | string | required | Account number, without the check digit. |
account_digit | string | required | Account check digit (1 character). |
account_type | string | required | checking_account or escrow_account. |
financial_institution_ispb | string | required | Institution ISPB, with 8 digits. |
financial_institution_code | string | optional | Institution COMPE code, with 3 digits. |
owner.document_number | string | required | Holder's CPF or CNPJ, with punctuation. |
Attributes of each assignor_discounts item
| Field | Type | Required | Description |
|---|---|---|---|
assignor_discount_type | string | required | expense_reimbursement (expense reimbursement) or others. |
total_value | number | required | Discount amount, in reais. Minimum 0.01. |
description | string | required | Discount description, from 1 to 500 characters. |
assignor_discount_key | string | optional | UUID v4 of the discount. If omitted, QI Tech generates one. |
Response
STATUS
201Response Body
{
"assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"status": "pending_assets_insertion"
}
Response attributes
| Field | Type | Description |
|---|---|---|
assignment_key | string | Unique batch identifier generated by QI Tech (UUID). |
external_id | string | The same external key provided in the request. |
status | string | Initial 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
| Status | Code | When it happens |
|---|---|---|
| 400 | TRC000014 | The assignment configuration is not active. |
| 400 | TRC000083 | assignment_date is earlier than the fund's current accounting date. Omit the field or send the current accounting date. |
| 400 | TRC000136 | assignor_discounts were sent, but the assignment configuration does not allow assignor discounts. |
| 400 | TRC000185 | disbursement was sent, but the assignment contract fixes a single disbursement account. |
| 404 | TRC000016 | The combination of fund_class_key and assignment_configuration_key does not match any assignment configuration. |
| 409 | TRC000041 | A batch with this external_id already exists. See Retry and duplicates. |
| 422 | TRC000161 | The configuration requires asset registration, but has no registry chamber configured. Contact the integration team. |
Authentication, permission and host errors: see API Errors.
Next steps
- Asset insertion — add the assets (CCBs, duplicatas, etc.) to be assigned to the fund.
- Document upload — upload the required documentation for each asset.
- Insertion closing — signal that all assets have been inserted so the batch moves on to the eligibility analysis.