Motivation MoneyMotivation Money
API 参考Payroll Runs

Confirm a draft payroll run

Locks the employee list and amounts. Transitions status from DRAFT to CONFIRMED. Cannot be undone — use cancel instead.

Requires payroll:execute scope. Requires Idempotency-Key header.

Allowed from status: DRAFT only.

POST
/payroll-runs/{run_id}/confirm
AuthorizationBearer <token>

API key: Authorization: Bearer mpk_live_<key>

In: header

Path Parameters

run_id*string

Payroll run identifier

Header Parameters

Idempotency-Key*string

UUID v4. Required on all write operations. Prevents duplicate execution on retry.

Formatuuid

Response Body

application/json

curl -X POST "https://motivation-money.vercel.app/api/v1/payroll-runs/run_cm5x8k2a3000108l3g8h1j2k4/confirm" \  -H "Idempotency-Key: 7f3c4d2a-8b1e-4f6a-9c2d-1a5b8e3f7d4c"
Empty
{
  "error": {
    "code": "INVALID_STATUS_TRANSITION",
    "message": "Cannot confirm a run in PAYING_OUT status.",
    "details": {
      "current_status": "PAYING_OUT",
      "allowed_transitions": [
        "CANCELLED"
      ]
    },
    "recovery_hint": "Check details.current_status and details.allowed_transitions."
  }
}