Budget request

Approve a budget request

Approves a pending request, optionally changing the amount (and, for a new budget, the budget to create). Only admin / budgets_manage users, who can approve their own requests too.

Effects

  • more_funds on a funded ("Con saldo") budget, without periods or with period_scope: current_period: tops the budget up from the company's free balance, like POST /v1/budgets/{id}/top_up. If the balance doesn't cover it, it fails like the top-up (budgets/insufficient_company_funds with unreserved_cents) and the request stays pending.
  • more_funds with period_scope: next_periods: raises the budget's base_amount_cents from the next renewal on. It moves no balance today, so it never fails for lack of funds; next_period_shortfall_cents over 0 warns that the company's free balance wouldn't cover renewing it with the new base today.
  • more_funds on a tracking ("Solo control") budget: raises its allocated_amount_cents (or its base_amount_cents with next_periods). No balance moves.
  • new_budget: creates the budget like POST /v1/budgets, with the request as default (funded, the requester as Encargado, the amount asked for) and budget overriding it. The request's budget_id points to it from then on.

Any failure leaves the request pending.

post/v1/budget_requests/{id}/approve

Request

  • Base URL
    https://api.cardda.com
  • URL
    https://api.cardda.com/v1/budget_requests/{id}/approve
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

The UUID of the budget request.

Parameters

#/paths/~1v1~1bills/get/parameters/0 (unresolved $ref)

Request body

approved_amount_centsinteger

The amount approved, if different from the one asked for. Must be over 0 (budget_requests/invalid_amount). For new_budget, budget.allocated_amount_cents takes precedence when sent.

period_scope'current_period' | 'next_periods'

more_funds only: overrides the one asked for. It's checked against the budget as it is now: required if it renews, and next_periods refused if it doesn't (budget_requests/invalid_period_scope).

Example request

{
  "approved_amount_cents": 400000
}

Response

The request, approved.

idstring uuid required
company_idstring uuid required
kind'more_funds' | 'new_budget' required
  • more_funds ("Más fondos"): more money for an existing budget (budget_id).
  • new_budget ("Presupuesto nuevo"): a budget that doesn't exist yet; approving it creates the budget and budget_id points to it from then on.
status'pending' | 'approved' | 'rejected' | 'withdrawn' | 'canceled' required
  • pending: waiting for an admin.
  • approved: an admin approved it; the money moved (or the budget was created).
  • rejected: an admin rejected it; resolution_note says why.
  • withdrawn: whoever asked withdrew it.
  • canceled: the budget closed while it was pending (resolution_note is budget_closed).
budget_idstring uuid nullable

The budget asked about (more_funds), or the one created on approval (new_budget). null for a new_budget request not approved.

requested_amount_centsinteger required

What was asked for.

approved_amount_centsinteger nullable

What the admin approved (the amount asked for unless changed). null until approved.

currencystring required
period_scope'current_period' | 'next_periods' | 'null' nullable

Only for more_funds on a recurring budget (null otherwise):

  • current_period: the money is for the period in progress.
  • next_periods: raises what each period starts with (base_amount_cents) from the next renewal on.
reasonstring

Why the requester needs it.

resolution_notestring nullable

The admin's note when rejecting it. budget_closed when it was canceled because its budget closed.

namestring nullable

Name of the budget asked for (new_budget only).

recurrence_unit'week' | 'month' | 'year' | 'null' nullable

How often the budget asked for should renew (new_budget only). null if it shouldn't.

recurrence_everyinteger nullable

How many recurrence_unit each period of the budget asked for spans (new_budget only).

participant_idsstring[]

Users the requester wants in the new budget (new_budget only; empty otherwise).

origin_channel'web' | 'whatsapp' required

Where it was asked from.

resolved_atstring date-time nullable

When it was approved, rejected, withdrawn or canceled.

created_atstring date-time required
next_period_shortfall_centsinteger required

How much the company's free balance falls short of renewing the budget with its new base today. Over 0 only for next_periods on a funded budget; 0 otherwise.

Example response

{
  "kind": "more_funds",
  "status": "pending",
  "requested_amount_cents": 500000,
  "approved_amount_cents": 400000,
  "currency": "CLP",
  "period_scope": "current_period",
  "reason": "Viaje a la feria de Santiago",
  "name": "Eventos Q4",
  "origin_channel": "web"
}

Changes

No recorded changes to this operation across all 1 revision of this API.