Creating a repurchase batch
Creates the batch (assignment) that will group the assets to be repurchased or sold. The batch starts in pending_assets_insertion.
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Granted by the integration team |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
Request
{
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"assignment_date": "2024-04-01",
"assignment_configuration_key": "d9308a2b-21fa-4724-9bbe-59ae65287b10",
"source_account": {
"document_number": "11.222.333/0001-81"
}
}
Body Params
| Field | Type | Description | Characters |
|---|---|---|---|
external_id * | string | Unique key identifying this batch in the integrating partner's system. | Up to 50 |
assignment_date * | string | Repurchase date. Must equal the fund's current accounting date. | YYYY-MM-DD |
assignment_configuration_key | string | Key of the repurchase configuration, provided by QI Tech. Send this or assignment_type. | 36 |
assignment_type | string | Batch type, when you use the fund's default configuration for that type: assignment_repurchase, wallet_sale or assignment_resolution. Send this or assignment_configuration_key. | Up to 50 |
source_account * | object | Account that will make the payment to the fund | - |
Send exactly one of assignment_configuration_key and assignment_type. With neither, the API returns TRR000017; with both, TRR000016.
Source account object
| Field | Type | Description | Characters |
|---|---|---|---|
document_number * | string | CPF or CNPJ, with mask, of whoever will make the payment to the fund. Must be a valid document. | 14 to 18 |
Response
{
"assignment_key": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"assignment_status": "pending_assets_insertion"
}
In case of error, resend the request. A duplicate (TRR000015) means the resource already exists: look it up instead of recreating it. Through assignor-api, the lookup is GET /trade_resolve/fund_class/{fund_class_key}/assignment/{external_id}; manager-api and consultant-api do not expose this lookup, so treat TRR000015 as a batch already created and move on to the asset insertion. See Retry and duplicates.
Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | QIT000001 | Body outside the contract: missing required field, unknown field, invalid format |
| 400 | TRR000014 | assignment_date different from the fund's accounting date |
| 400 | TRR000002 | source_account.document_number is not a valid CPF or CNPJ |
| 400 | TRR000016 | assignment_configuration_key and assignment_type sent together |
| 400 | TRR000017 | Neither assignment_configuration_key nor assignment_type was sent |
| 400 | TRR000019 | The repurchase configuration is not active |
| 403 | TRR000049 | The agent does not have access to this fund or this repurchase configuration |
| 404 | TRR000006 | There is no fund with this fund_class_key |
| 404 | TRR000013 | Repurchase configuration not found for the fund (or the fund has no default configuration for the assignment_type) |
| 404 | TRR000018 | assignment_type does not exist |
| 409 | TRR000015 | A batch with this external_id already exists in the fund |
Authentication, permission and host errors: see API errors.