Create Vendor Deposit from Milestone
POST/api/purchase-orders/:purchase_order/expected-vendor-deposit-milestones/:milestoneKey/create-deposit
Create a draft vendor deposit from a payment-term schedule milestone. No request body — the milestone key (from List Expected Vendor Deposit Milestones) fully identifies the action.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Only milestones with is_ready_to_create: true and settlement_type: vendor_deposit can be materialized. The created deposit:
- starts in
draftstatus with an auto-assigned number (e.g.VD-00092) - copies supplier, currency, and rate from the purchase order
- takes its amount and due date from the milestone, and records the schedule line and shipment it came from
- does not post any accounting entries while in draft
The call is idempotent against races — if a deposit already exists for the same schedule line and shipment, that deposit is returned instead of creating a duplicate.
Errors:
- 404 — unknown milestone key for this purchase order
- 422 — the milestone already has a linked vendor deposit
- 422 — the milestone's trigger event has not happened yet
Synchronous — no background processing. Requires the purchase-orders:write token scope and permission to update purchase orders.
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
Created
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
Response Headers
Unprocessable Entity
Response Headers
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.