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
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Create Expense Contracts |
Base URL for each host: Environments (Hosts).
ENDPOINT
/expense_contract/fund_class/{fund_class_key}/contractMETHOD
POSTPath parameters
| Parameter | Type | Description |
|---|---|---|
fund_class_key | string | Fund 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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Contract name, from 1 to 255 characters. |
vendor_key | string | Yes | Vendor key, 36 characters. |
signature_method | string | Yes | certifiqi or qi_sign: electronic signature through QI Tech. external: the uploaded document is already signed. See Contract signature. |
expense_types | array | Yes | The contract's expense types, without repetition. Each item has only expense_type. See accepted types. |
expense_types[].expense_type | string | Yes | Expense type. |
recurrences | array | No | Automatic monthly expenses, retrieved in Recurring expenses. If sent, it must have exactly one item for each type in expense_types. |
recurrences[].expense_type | string | Yes | Expense type of the recurrence. |
recurrences[].description | string | Yes | Description of the generated expenses, from 1 to 200 characters. |
recurrences[].amount | number | Yes | Monthly amount, greater than zero. |
recurrences[].start_date | string | Yes | Start, YYYY-MM-DD. |
recurrences[].end_date | string | Yes | End, YYYY-MM-DD, or null for a recurrence with no end. Cannot be earlier than start_date. |
expiration_date | string | No | Contract 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
201Response 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
| Field | Type | Description |
|---|---|---|
contract_key | string | Contract key (UUID). |
name | string | Contract name. |
status | string | Status. See contract status. |
fund_class_key | string | Fund class key. |
fund_class | object | fund_class_key, name, document_number, manager_key. |
vendor | object | vendor_key, name, document_number, status and agent_key (owner of the vendor). status is created, pending_analysis, registered (approved vendor), inactive or expired. |
consultant_key | string | Consultant that posted the contract, or null. |
signature_method | string | certifiqi, qi_sign or external. null for contracts created by QI Tech during the fund structuring. |
expiration_date | string | Expiration, YYYY-MM-DD, or null. |
ai_analysis | object | Latest 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_reason | string | Rejection reason, or null. See reasons. |
reproval_details | string | Rejection details, up to 1000 characters, or null. |
amended_contract_key | string | If the contract is an amendment, the contract it replaces. Otherwise, null. |
root_contract_key | string | Original contract of the amendment chain, or null. |
created_at | string | Creation, ISO 8601 without a time zone. |
expense_types | array | expense_type and sub_class_key (always null in contracts created through the API). |
parametrizations | array | The 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. |
attachments | array | Attachments: attachment_key, status, created_at. See Attachments. |
terminations | array | Termination 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
| Status | code | When it happens |
|---|---|---|
| 400 | QIT000001 | Invalid body: required field missing, repeated type in expense_types, value outside the list or unexpected field. |
| 400 | ECT000040 | expiration_date is not a valid date, such as 2027-02-30. |
| 400 | ECT000012 | The expense type is contracted during fund structuring: administration_tax, management_tax, performance_fee or credit_rights_registration_fee. |
| 400 | ECT000010 | The expense type does not exist or does not use a contract. See accepted types. |
| 400 | ECT000061 | A recurrence has end_date earlier than start_date. |
| 400 | ECT000045 | recurrences does not have exactly one recurrence for each declared type. |
| 404 | ECT000005 | The fund class does not exist or you do not have access to it. |
| 404 | ECT000008 | The vendor does not exist, or belongs neither to the manager nor to a consultant with the Create Expense Contracts permission on the fund. |
| 409 | ECT000015 | The vendor is inactive. |
| 409 | ECT000059 | The vendor's registration has expired (expired). |
| 409 | ECT000014 | The 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. |
| 409 | ECT000029 | A 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.