list_statements returns (a row’s
id, not a user id), 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, when the state asked for is already there, so you can send the same call again, or when the web app would refuse that statement: a calculation error, a calculation still running, a paid statement to unlock (unpay it first), a payment with a mandatory approval pending, a validation already requested, or an unpay whose last validation is not its payment. - Failed on Qobra’s side, in which case it may be changed in part. Read it with
get_statementbefore retrying.
warning, such as the user’s previous period left unlocked.
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.
Paying needs a locked statement with no calculation error and no mandatory
stage awaiting approval. No payment date is recorded. In the live environment,
Qobra notifies the owner of each statement locked or paid, and a live payroll
webhook, if the company has one, receives the statement, as from the web app.
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.
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, when a template is passed with another action than
lock, 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. 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
lock freezes the amounts, before approval and payment. 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.