ms_create_purchaseorder
Create a purchase order as a draft, without posting to inventory. Requires confirm_write=true to complete the creation.
Instructions
Create a purchase order as a DRAFT (applicable=false — not posted, moves nothing). WRITE — requires confirm_write=true. Posting is separate (ms_post_document). Writes also require MOYSKLAD_ALLOW_WRITE=1 (off by default).
Args: same as ms_build_purchaseorder, plus confirm_write. Returns the created document envelope {"ok": true, "data": {... "id" ...}}, or the guard/gate error (nothing sent).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| agent | Yes | ||
| store | No | ||
| moment | No | ||
| positions | No | ||
| description | No | ||
| organization | No | ||
| confirm_write | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |