Return a settlement surplus to the account holder
Moves a pix_manual surplus from the blocking account back to the account holder. Use it when a pix_manual settlement paid the payer less than the lock held and the surplus did not go back to the holder: the lock was closed manually, or the surplus return of a settlement confirmation answered without surplus_midaz_tx_id. That answer does not prove that the surplus stayed blocked, because a ledger timeout can have moved it. Before you call, search the ledger for a transaction whose metadata carries the lock_id and an origin of balance-lock-surplus, balance-lock-group-surplus or balance-lock-surplus-recovery. Call only when none exists.
The lock must be SETTLED: a SETTLING lock with a surplus is refused with 409 (PIX-0653), so confirm the settlement first. X-Actor-Id and X-Override-Reason are required. The call is idempotent: a lock with no surplus, or whose surplus was already returned, answers 200 with surplus_amount 0. After a 5xx that returns no surplus_midaz_tx_id, the surplus can have moved: check the ledger before you retry. For a group settlement, call it once for each lock_id. Pix Lerian records every call in the audit trail.
Authorizations
JWT bearer token issued by the identity provider.
Headers
REQUIRED. Client-supplied replay key, at most 64 bytes. A request without it is refused with PIX-0030 @ 400 before the handler runs. An identical resend within 1 hour returns the original response, status included, with X-Idempotency-Replayed: true. Reusing the key with a divergent method, URL or body is PIX-0031 @ 412.
1 - 64Who is acting. Declared by the caller; not verified against the access token
"backoffice.ops@example.com"
Why the caller is acting
"manual devolution paid by Pix"
Ticket reference
"MED-4821"
Correlation id
"med-2026-000123"
Request id
"01a17e29-5302-7c0a-b5e1-94d2f6a83c17"
Path Parameters
Balance lock UUID
"01a17cf3-128e-7c41-9b2e-5d7a3f8c1e60"
Response
OK
"01a17cf3-128e-7c41-9b2e-5d7a3f8c1e60"
"2026-10-27T15:02:41Z"
"0.00"
Midaz transaction that moved the surplus: created by this call, or already recorded on the lock or, for a group settle, on another lock of the same group (then surplus_amount is 0). Absent when no surplus transfer exists.
"01a17dae-b16e-7f28-9a03-6b1c4d8e2f75"

