Create a purchase requisition (draft)
precoro_create_purchase_requisitionWRITE: create a purchase requisition in draft (open) status for the key user; it is not submitted for approval until precoro_submit_document is called. Needs a location id, a currency, a delivery date and at least one item (a catalog item_id, or a name with quantity and price). Find ids with precoro_list_reference_data (locations, legal_entities, document_custom_fields) and precoro_list_items. All required document custom fields (for example department or project) must be passed in custom_fields. Returns the new idn and id. POST /purchaserequisitions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Plain-text note (stored as HTML). | |
| items | Yes | ||
| currency | Yes | ||
| budget_id | No | Budget line id. | |
| location_id | Yes | Location id (must be accessible to the key user). | |
| custom_fields | No | Document custom field values (department, project, GL account...). Every required one must be given. | |
| required_date | Yes | Delivery date, yyyy-mm-dd. | |
| legal_entity_id | No | Required when the company uses legal entities. |