Skip to main content

Contract creation

Creates an expense contract between the fund and a vendor. The contract starts in pending_submission. Next, upload the document and submit the contract for review.

Create contract​

Available on
ProfileHostRequired permission
Managermanager-apiWrite
Consultantconsultant-apiCreate Expense Contracts

Base URL for each host: Environments (Hosts).

ENDPOINT
/expense_contract/fund_class/{fund_class_key}/contract
METHOD
POST

Path parameters​

ParameterTypeDescription
fund_class_keystringFund class key (UUID).
Request body
{
"name": "Contrato de auditoria 2027",
"vendor_key": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
"signature_method": "certifiqi",
"expense_types": [
{
"expense_type": "audit_tax"
}
],
"recurrences": [
{
"expense_type": "audit_tax",
"description": "Auditoria anual - parcela mensal",
"amount": 2500.00,
"start_date": "2027-01-01",
"end_date": "2027-12-31"
}
],
"expiration_date": "2027-12-31"
}

Body attributes​

FieldTypeRequiredDescription
namestringYesContract name, from 1 to 255 characters.
vendor_keystringYesVendor key, 36 characters.
signature_methodstringYescertifiqi or qi_sign: electronic signature through QI Tech. external: the uploaded document is already signed. See Contract signature.
expense_typesarrayYesThe contract's expense types, without repetition. Each item has only expense_type. See accepted types.
expense_types[].expense_typestringYesExpense type.
recurrencesarrayNoAutomatic monthly expenses, retrieved in Recurring expenses. If sent, it must have exactly one item for each type in expense_types.
recurrences[].expense_typestringYesExpense type of the recurrence.
recurrences[].descriptionstringYesDescription of the generated expenses, from 1 to 200 characters.
recurrences[].amountnumberYesMonthly amount, greater than zero.
recurrences[].start_datestringYesStart, YYYY-MM-DD.
recurrences[].end_datestringYesEnd, YYYY-MM-DD, or null for a recurrence with no end. Cannot be earlier than start_date.
expiration_datestringNoContract expiration, YYYY-MM-DD, or null. If not provided, the automated reading fills it in with the date found in the document.

Fields not listed in this table are rejected with QIT000001.

Response​

STATUS
201
Response body
{
"contract_key": "3f2b8c1e-7d4a-4e9b-9a61-0c5d2e8f4b17",
"name": "Contrato de auditoria 2027",
"status": "pending_submission",
"fund_class_key": "9a7c3d52-1b8e-4f0a-8c2d-6e4b1f9a0d33",
"fund_class": {
"fund_class_key": "9a7c3d52-1b8e-4f0a-8c2d-6e4b1f9a0d33",
"name": "FIDC EXEMPLO",
"document_number": "33.444.555/0001-81",
"manager_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c"
},
"vendor": {
"vendor_key": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
"name": "AUDITORES EXEMPLO S.A.",
"document_number": "44.555.666/0001-81",
"status": "registered",
"agent_key": "a7498c6c-1893-42ec-a8f3-bc6ad0c6b52c"
},
"consultant_key": null,
"signature_method": "certifiqi",
"expiration_date": "2027-12-31",
"ai_analysis": null,
"reproval_reason": null,
"reproval_details": null,
"amended_contract_key": null,
"root_contract_key": null,
"created_at": "2026-11-09T14:03:22.512345",
"expense_types": [
{
"expense_type": "audit_tax",
"sub_class_key": null
}
],
"parametrizations": [
{
"parametrization_key": "0b1c2d3e-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
"expense_type": "audit_tax",
"sub_class_key": null,
"status": "pending",
"target": "recurring_expense",
"external_configuration_key": null,
"configuration_data": {
"expense_type": "audit_tax",
"description": "Auditoria anual - parcela mensal",
"amount": 2500.0,
"start_date": "2027-01-01",
"end_date": "2027-12-31"
}
}
],
"attachments": [],
"terminations": []
}

Contract attributes​

FieldTypeDescription
contract_keystringContract key (UUID).
namestringContract name.
statusstringStatus. See contract status.
fund_class_keystringFund class key.
fund_classobjectfund_class_key, name, document_number, manager_key.
vendorobjectvendor_key, name, document_number, status and agent_key (owner of the vendor). status is created, pending_analysis, registered (approved vendor), inactive or expired.
consultant_keystringConsultant that posted the contract, or null.
signature_methodstringcertifiqi, qi_sign or external. null for contracts created by QI Tech during the fund structuring.
expiration_datestringExpiration, YYYY-MM-DD, or null.
ai_analysisobjectLatest automated reading of the document: ai_analysis_key, status (sent, valid, inconclusive or failed) and analysis_result (data read from the document, or null). It is null before the contract is submitted for review.
reproval_reasonstringRejection reason, or null. See reasons.
reproval_detailsstringRejection details, up to 1000 characters, or null.
amended_contract_keystringIf the contract is an amendment, the contract it replaces. Otherwise, null.
root_contract_keystringOriginal contract of the amendment chain, or null.
created_atstringCreation, ISO 8601 without a time zone.
expense_typesarrayexpense_type and sub_class_key (always null in contracts created through the API).
parametrizationsarrayThe contract's recurrences: parametrization_key, expense_type, sub_class_key, status, target, external_configuration_key and configuration_data (the recurrence sent). See the status and target values below.
attachmentsarrayAttachments: attachment_key, status, created_at. See Attachments.
terminationsarrayTermination requests: termination_key, status, termination_details, reproval_details, created_at. See Termination.

parametrizations[].status:

  • pending: the contract has not taken effect yet.
  • active: the contract is in effect.
  • inactive: the contract was canceled, rejected, superseded or expired.
  • canceled: the recurrence was removed by an edit.

parametrizations[].target is recurring_expense. Contracts from the fund structuring also carry quota_fee, performance_fee and expense_control.

Errors​

StatuscodeWhen it happens
400QIT000001Invalid body: required field missing, repeated type in expense_types, value outside the list or unexpected field.
400ECT000040expiration_date is not a valid date, such as 2027-02-30.
400ECT000012The expense type is contracted during fund structuring: administration_tax, management_tax, performance_fee or credit_rights_registration_fee.
400ECT000010The expense type does not exist or does not use a contract. See accepted types.
400ECT000061A recurrence has end_date earlier than start_date.
400ECT000045recurrences does not have exactly one recurrence for each declared type.
404ECT000005The fund class does not exist or you do not have access to it.
404ECT000008The vendor does not exist, or belongs neither to the manager nor to a consultant with the Create Expense Contracts permission on the fund.
409ECT000015The vendor is inactive.
409ECT000059The vendor's registration has expired (expired).
409ECT000014The expense type is already in another in-progress, active or expired contract of this fund with this vendor. The message mentions sub class None because contracts created through the API have no sub-class.
409ECT000029A contract of this fund with this vendor was permanently rejected by compliance. No new contract can be created between the two.
Example
{
"title": "Expense type already contracted",
"description": "The expense type audit_tax for the sub class None is already in another open, active or expired contract of this fund class and vendor.",
"translation": "O tipo de despesa audit_tax da sub-classe None ja esta em outro contrato em andamento, ativo ou expirado deste fundo e fornecedor.",
"code": "ECT000014"
}

Authentication, permission and host errors: see API Errors.

Next step​

Contract document: get the upload URL and upload the PDF.