Skip to main content
Lock, unlock, pay or unpay statements, and request their validation when locking. Locking freezes a statement’s amounts, the step before it can be approved and paid. Paying marks a locked statement as sent to payroll, and unpaying cancels that payment. Pass the statement ids 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, paid or unpaid.
  • 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_statement before retrying.
A row may carry a 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

string[]
required
The id of rows of list_statements, not user ids, at most 50.
string
required
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.
string
With lock only: the id of a template from list_validation_workflow_templates, to request that validation on each statement. 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:
Mark locked statements as paid:

Response

Body

object[]
One row per statement, in the order first sent: an id sent twice is changed and reported once.