Skip to main content

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.

Required scope: purchase-orders:write

Grant 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 draft status 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

Created

Response Headers
    Content-Type