list_statements returns, at most
50 per call. Only statements you can see can be changed.
Each statement sent gets one row saying what happened to it:
- Changed:
locked,locked_and_validation_requested,validation_requested,unlocked,paidorunpaid. - Skipped, with the reason in
reason: already locked, paid, in error, still being calculated, or a validation already requested. - Failed on Qobra’s side, in which case it may be changed in part.
reasonsays what to do.
warning, such as the previous period of that user left
unlocked. Sending a state already there skips the statement, so you can send
the same call again.
Unlocking is destructive. Qobra recalculates the statement’s amounts. For a
company that has validation workflows, Qobra also clears the statement’s
validation workflow with every approval already given, even while the module is
switched off in the settings. A paid statement cannot be unlocked: unpay it
first.
Paying needs a locked statement with no calculation error, and none of its
validation workflow’s mandatory stages still awaiting approval. Paying is an
outbound action. Qobra notifies the owner of each statement paid and, where the
company has a live payroll webhook, sends the statement to it, as from the web
app. No payment date is recorded. To approve the stages a payment waits on, use
approve_statements.
Unpaying cancels the payment in Qobra only: it recalls nothing already sent to
payroll, and leaves the statement locked. It refuses a statement whose last
validation is not its payment.
To request a validation, pass validation_workflow_template_id with lock.
Read the template ids with
list_validation_workflow_templates.
A statement still open is locked first when your role may lock; one already
locked gets the workflow only. Qobra assigns the template’s workflow and
notifies its approvers, as the web app does.
The whole call is refused before anything changes when one id names no
statement you can see, or when the validation workflow is switched off and a
template is passed. Each statement changes in the environment it lives in.
Locking and unlocking require the lock permission on statements. Paying and
unpaying require the payment permission. Requesting a
validation on a statement already locked requires only the permission to
request one. Available only where the Qobra write tools beta is enabled.
Every write to the live environment is recorded in the audit trail as the
Qobra MCP agent; writes to a sandbox are not audited.
Parameters
Body
Body
string[]
required
Ids of the statements to change — the ids list_statements returns. At most
50 per call.
string
required
lock freezes the statements’ amounts, the step before they can be approved
and paid. unlock reopens locked statements. pay marks locked statements as
sent to payroll. unpay cancels that payment, leaving them locked. One of:
lock, unlock, pay, unpay.string
With lock only: the id of the validation workflow to request on each
statement, one of list_validation_workflow_templates’ ids. A statement still
open is locked first when your role may lock; one already locked gets the
workflow only. Omit it to lock without requesting a validation.
Example
Lock two statements and request their validation:Response
Body
Body
object[]
One row per statement, in the order first sent: an id sent twice is changed
and reported once.