List Expected Vendor Deposit Milestones
GET/api/purchase-orders/:purchase_order/expected-vendor-deposit-milestones
List the expected payment milestones for a purchase order, derived from its payment-term deposit schedule.
purchase-orders:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Returns one row per schedule line. Per-shipment lines fan out into one row per inbound shipment (key line-{n}-shipment-{id}), plus a line-{n}-remainder row for PO value not yet assigned to a shipment. If the payment term has no schedule, a single synthesized Final Invoice Balance milestone (key synthesized-final-balance) covers the un-deposited remainder.
Each milestone's status is one of:
expected— planned but the trigger event has not happened yetready_to_create— the trigger has been reached; the milestone can be turned into a vendor depositcreated— a vendor deposit is already linked (linked_vendor_deposit_id)out_of_sync— the linked deposit no longer matches the schedule (amount, due date, trigger, or shipment changed); seestatus_reasons
Use the key value with Create Vendor Deposit from Milestone to materialize a ready_to_create milestone.
Read-only. Requires the purchase-orders:read token scope.
Drift classification (schedule revisions): each milestone now returns drift_notes (string[]) alongside status_reasons. For deposits that are already settled (partially paid, paid, or applied), amount/due-date drift is informational only — the row stays created and the drift appears in drift_notes (money variance is owned by the shortfall/overage report). Only structural drift (trigger event or shipment linkage changed) or any drift on an unsettled deposit flags out_of_sync. When the deposit was created under an earlier schedule revision, the first note reads “This deposit was created under schedule revision N; the payment term is now at revision M.” linked_vendor_deposit_amount (number|null) is the linked deposit's recorded amount for old→new comparisons.
Provenance fields: linked_vendor_deposit_created_via (auto_schedule | milestone | manual), linked_vendor_deposit_created_via_label, and linked_vendor_deposit_amount_overridden_at (ISO timestamp when a user edited the amount after creation, null otherwise). These power the user-authored resync default and the provenance chips in the UI.
Request
Responses
- 200
- 401
- 403
- 404
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.