Skip to main content

Manager decision on a consultant expense

When the consultant linked to the fund creates an expense or submits an invoice, QI Tech analyzes it first. Then the expense or the invoice stays in pending_manager_approval, waiting for the manager to approve or reject it. There are two calls:

What awaits the decisionWhere it shows upCall
The expense with provisionExpense pending_manager_approvalDecide on the expense
The invoice (consolidation analysis)consolidation_analysis.status pending_manager_approvalDecide on the invoice

To find what awaits the manager, filter the expense list with status=pending_manager_approval, or the analysis list with status=pending_manager_approval.

Whoever created or submitted the expense or the invoice, or opened the current analysis, cannot decide on it. Through the API, the identity compared is the manager's key. Expenses created by the manager itself do not go through this step.

Decision body​

Both calls use the same body.

Request body — rejection
{
"status": "reproved",
"reproval_details": "Valor diverge do orçamento aprovado."
}
FieldTypeRequiredDescription
statusstringYesapproved or reproved.
reproval_detailsstringConditionalReason for the rejection, from 1 to 1000 characters. Required with reproved; ignored with approved.

Decide on the expense​

Available on
ProfileHostRequired permission
Managermanager-apiWrite

Base URL for each host: Environments (Hosts).

ENDPOINT
/expense/fund_class/{fund_class_key}/expense/{expense_key}
METHOD
PUT

Approves or rejects a consultant expense in pending_manager_approval. Allowed with the consolidation analysis not under review; if the invoice is under review, decide on the invoice.

STATUS
200

The expense, in the structure of retrieval by key, with permission_type: viewer, without status_events and consolidation_status_events:

  • Rejected: reproved, with reproval_reason: manager_reproval. The current consolidation analysis also becomes reproved.
  • Approved: enters the portfolio in in_provision, or moves to pending_contract_analysis if the contract is still under analysis. Payment or provision dates that have already passed move to the first business day from today.

Decide on the invoice​

Available on
ProfileHostRequired permission
Managermanager-apiWrite

Base URL for each host: Environments (Hosts).

ENDPOINT
/expense/fund_class/{fund_class_key}/expense/{expense_key}/consolidation_analysis
METHOD
PUT

Approves or rejects the consultant's invoice. Allowed with the consolidation analysis in pending_manager_approval.

STATUS
200

The consolidation analysis, in the structure of Consolidation analysis:

  • Rejected: analysis reproved, with reproval_reason: manager_reproval.
    • An expense still in in_manual_analysis or pending_manager_approval is rejected along with it.
    • On a rebate, the expense does not change, and the management fee's analysis, if still open, is rejected with rebate_inconsistency.
  • Approved: analysis approved.
    • The expense is consolidated, and the payment is scheduled for the analysis date or the first available business day (after 5 p.m., the next one).
    • An expense not yet in the portfolio enters it before being consolidated, or moves to pending_contract_analysis if the contract is still under analysis.
    • On the management fee, the approved rebates are consolidated first, each by its own amount. total_rebate_value becomes their sum, and the fee is consolidated by payment_value (the net amount).
    • On a rebate, only the analysis is approved; the rebate is consolidated together with the management fee.

Errors​

StatuscodeWhen it happens
400EXP000154The expense or the analysis is not in pending_manager_approval.
400EXP000162The expense's invoice is under review: decide on the invoice.
400EXP000150reproved without reproval_details.
400QIT000001Invalid body: no status, status other than approved and reproved, reproval_details empty or longer than 1000 characters, or an unexpected field.
400EXP000153Approval: the contract no longer accepts the expense.
400EXP000037, EXP000008, EXP000009, EXP000027Approval of an expense not yet in the portfolio: dates incompatible with the fund's accounting date or not on a business day.
400EXP000157Approval of the management fee's invoice with rebates still under analysis.
400EXP000085, EXP000086, EXP000036Invoice approval: the expense has no payee or payment destination.
400EXP000043, EXP000044Approval of an invoice paid by bank slip: the digitable line is missing, or the bank slip amount differs from the consolidated amount.
400EXP000011, EXP000051, EXP000073, EXP000074Invoice approval: the expense is already consolidated, canceled, paid or completed.
400EXP000069The fund class does not belong to the manager.
403EXP000207You created or submitted the expense or the invoice, or opened the current analysis: you cannot decide on it.
404EXP000010The expense does not exist in the fund.
503EXP000132The API could not read the contract. Try again.
Example
{
"title": "Expense Not Pending Manager Approval",
"description": "The expense is in status pre_approved, not pending manager approval.",
"translation": "A despesa esta no status pre_approved, nao aguardando aprovacao do gestor.",
"code": "EXP000154"
}

Authentication, permission and host errors: see API Errors.