Skip to main content

Public Securities Recorder

Records a trade ticket for an outright purchase or sale, or for a repo purchase, of a federal government security (LFT, LTN, NTN-B, NTN-F) for the fund. The ticket is registered in SELIC after the manager approves it.

Available on
ProfileHostRequired permission
Managermanager-apiWrite

Base URL for each host: Environments (Hosts).

Approval is done in the portal

Every ticket starts in pending_manager_approval, and the integration API does not expose the approval. To approve, open the manager portal at Ativos › Negociações › Títulos Públicos, open the operation and click Aprovar operação. On the same screen you can cancel the operation or, after the cut-off time, request a time exception. Track progress through the operation query or the listing.

Cut-off time: 16:55 (Brasília time)

From 16:55 (America/Sao_Paulo, inclusive), nothing enters SELIC on the same day:

  • the POST is only accepted with time_exception_reason filled in (without it, TTR000054);
  • approval in the portal is also refused after the cut-off. The manager can then request a time exception, and the ticket stays in pending_time_exception_approval until the QI Tech team reviews the justification and releases it (or cancels it).

Before 16:55, time_exception_reason is ignored.

Request​

ENDPOINT
/trade_treasury/fund_class/{fund_class_key}/operation
METHOD
POST

Path params​

ParameterTypeDescription
fund_class_keystringUnique identifier of the fund.
Request Body
{
"external_id": "a3f1c2e4-7b8d-4e6f-9a0b-1c2d3e4f5a6b",
"operation_date": "2025-12-04",
"payment_date": "2025-12-04",
"operation_part": "assignee",
"operation_type": "outright_operation",
"counterparty": {
"iselic_number": "33444555",
"selic_account_number": "123456789",
"document_number": "33.444.555/0001-81"
},
"treasury_type": "ntn_b",
"unit_price": 1234.567891,
"units": 10,
"maturity_date": "2035-05-15"
}

Body attributes​

FieldTypeRequiredDescription
external_idstringoptionalYour identifier for the ticket, unique per fund. If not provided, it is generated automatically (UUID). Maximum 36 characters. See Retry and duplicates.
operation_datestring (date)requiredOperation date in YYYY-MM-DD format. Must be a business day and equal to the fund's accounting_date.
payment_datestring (date)requiredSettlement date in YYYY-MM-DD format. Must be >= operation_date. For non-term operations (outright_operation, buyback_operation), it must equal operation_date.
operation_partstringrequiredFund's role in the operation: assignee (buyer) or assignor (seller). With assignor, units cannot exceed the units of this security in the fund's portfolio.
operation_typestringrequiredOperation type: outright_operation (outright) or buyback_operation (repo). buyback_operation requires operation_part == "assignee" and the fund to be enabled for repo operations. term_outright_operation is not available yet (TTR000042).
counterpartyobjectrequiredCounterparty data. See object below.
treasury_typestringrequiredSecurity type: lft, ltn, ntn_b or ntn_f.
unit_pricenumberrequiredUnit price of the security. Accepts any decimal precision; the server truncates down according to the type: buyback_operation → 8 decimal places; others → 6 decimal places.
unitsintegerrequiredNumber of securities (positive integer).
maturity_datestring (date)requiredSecurity maturity date (YYYY-MM-DD). Must be strictly after operation_date.
yearly_negotiated_ratenumberconditionalAnnual negotiated rate, in decimal form (0.144 = 14.4% p.a.). Required for buyback_operation.
return_datestring (date)conditionalReturn date (YYYY-MM-DD). Required for buyback_operation. Must be > operation_date.
time_exception_reasonstringconditionalJustification for recording a ticket after hours. Required from 16:55 (Brasília time); ignored before that. Maximum 500 characters.

counterparty object​

FieldTypeRequiredDescription
iselic_numberstringrequiredCounterparty iSELIC number (8 digits).
selic_account_numberstringrequiredCounterparty SELIC account (9 digits).
document_numberstringrequiredCounterparty CNPJ with punctuation (format XX.XXX.XXX/XXXX-XX), with a valid check digit.

Response​

STATUS
201
Response Body
{
"operation_key": "85cfd700-54a4-40f4-bc61-2ece992864ea",
"external_id": "a3f1c2e4-7b8d-4e6f-9a0b-1c2d3e4f5a6b",
"fund_class": {
"fund_class_key": "5122bf31-660a-4f61-a447-38e5e17162dd",
"manager_key": "bea7581a-f901-4995-a486-46e18ae61aab",
"name": "FUNDO EXEMPLO DTVM",
"document_number": "11.222.333/0001-81",
"accounting_date": "2025-12-04"
},
"status": "pending_manager_approval",
"operation_part": "assignee",
"operation_type": {
"enumerator": "outright_operation",
"code": 1052
},
"treasury": {
"enumerator": "ntn_b",
"code": 760199
},
"operation_date": "2025-12-04",
"payment_date": "2025-12-04",
"maturity_date": "2035-05-15",
"total_operation_value": 12345.67,
"units": 10,
"unit_price": 1234.567891,
"counterparty": {
"iselic_number": "33444555",
"document_number": "33.444.555/0001-81",
"selic_account_number": "123456789"
},
"isin_code": "BRSTNCNTB633",
"issue_date": "2025-11-04",
"operation_data": {}
}

Response attributes​

FieldTypeDescription
operation_keystringUnique operation identifier generated by QI Tech (UUID).
external_idstringExternal identifier provided or generated automatically.
fund_classobjectData of the fund associated with the operation.
statusstringInitial operation status: always pending_manager_approval. See the operation statuses.
operation_partstringassignee (buyer) or assignor (seller).
operation_typeobject{ enumerator, code } — operation type and corresponding SELIC code.
treasuryobject{ enumerator, code } — security type and corresponding SELIC code.
operation_datestringOperation date (YYYY-MM-DD).
payment_datestringSettlement date (YYYY-MM-DD).
maturity_datestringSecurity maturity date (YYYY-MM-DD).
total_operation_valuedecimalTotal operation value (units × unit_price).
unitsintegerNumber of securities.
unit_pricenumberUnit price of the security.
counterpartyobjectCounterparty data (iselic_number, document_number, selic_account_number).
isin_codestringSecurity ISIN code.
issue_datestringSecurity issue date (YYYY-MM-DD).
operation_dataobjectAdditional internal operation metadata.
yearly_negotiated_rate, return_date, return_unit_price, total_return_valuenumber / stringReturn data. Present in buyback_operation.
time_exception_reasonstringTime justification. Present when the ticket was sent after the cut-off.

Retry and duplicates​

If an error occurs, resend the request. A duplicate (TTR000044) means the ticket already exists: find it in the listing by filtering on operation_date and looking for your external_id among the items in data. See Retry and duplicates.

Errors​

StatusCodeWhen it happens
409TTR000044A ticket with this external_id already exists in the fund.
400TTR000054Sent from 16:55 (Brasília time) without time_exception_reason.
400TTR000058Nonexistent date in operation_date, payment_date, maturity_date or return_date (for example, 2025-02-30).
400TTR000016operation_date differs from the fund's accounting date.
400TTR000011operation_date is not a business day.
400TTR000021payment_date differs from operation_date in a non-term operation.
400TTR000017payment_date is before operation_date.
400TTR000010maturity_date is on or before operation_date.
400TTR000057Sale (operation_part: assignor) with units above the units of this security in the fund's portfolio.
400TTR000037There is no security in ANBIMA with this treasury_type and maturity_date.
400TTR000018 / TTR000019 / TTR000020Repo without yearly_negotiated_rate, without return_date, or with return_date on or before operation_date.
400TTR000042operation_type not implemented, repo with operation_part: assignor, or fund without repo enabled.
400TTR000035Invalid counterparty CNPJ.
400TTR000027 / TTR000028 / TTR000029 / TTR000038 / TTR000048The fund's public securities setup is incomplete (destination account, custodian, SELIC account or portfolio). Contact the integration team.
404TTR000004The fund_class_key does not exist.
403TTR000040The fund does not belong to your manager.

Authentication, permission and host errors: see API errors.