Skip to main content

Resync Vendor Deposit with Milestone

POST 

/api/purchase-orders/:purchase_order/expected-vendor-deposit-milestones/:milestoneKey/resync-deposit

Resolve an out-of-sync schedule milestone by realigning its linked vendor deposit with the milestone's current state — the one-click alternative to deleting and recreating the deposit.

Behavior depends on the deposit's progress: draft / pending-approval deposits are fully realigned (amount and due date update to the milestone's current expectation, and the stored schedule link refreshes); approved / paid / partially-applied deposits have a locked amount, so the resync acknowledges the schedule change (due date + schedule link refresh) while the amount stays as recorded — any under-funding remains visible in the cash-flow shortfall report.

Returns the resynced deposit plus the purchase order's refreshed milestone list. 404 when the milestone key is unknown; 422 when the milestone has no linked deposit, is already in sync, or the deposit is in a terminal state (cancelled, void, refunded, written off).

Direction (mode, optional): realign overwrites the deposit's amount/due date with the schedule's current expectation; keep_amount keeps the recorded amount and only refreshes the due date + frozen schedule snapshot so the milestone stops flagging. When omitted, the server picks the safe default by amount authorship: a deposit whose amount still equals its own frozen snapshot is system-authored → realign; a manually recorded deposit (no snapshot) or a draft whose amount was edited after creation is user-authored → keep_amount (the deposit is the definitive document). Locked non-terminal deposits always acknowledge only (amount never changes); terminal deposits are refused. The milestone list response includes linked_vendor_deposit_amount_is_user_authored (boolean) so clients can present the right default.

Request

Responses

OK

Response Headers
    Content-Type