CreatePurchase
CreatePurchaseCreates a new purchase order.
Parameters:
| Parameter | Type | Description |
|---|---|---|
input | PurchaseInput! | Purchase data. |
Example Query:
mutation CreatePurchase($input: PurchaseInput!) {
CreatePurchase(input: $input) {
... on Purchase {
id
label
status
}
... on ValidationRuleWarning {
message
document_id
}
}
}UpdatePurchase
UpdatePurchaseUpdates an existing purchase order.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | Int! | ID of the purchase. |
input | PurchaseInput! | Updated data. |
DeletePurchase / DeletePurchases
DeletePurchase / DeletePurchasesDeletes one or multiple purchase orders.
ValidatePurchase / RejectPurchase
ValidatePurchase / RejectPurchaseApprove or reject a purchase order in validation workflow.
TransformIntoPurchaseReceipt
TransformIntoPurchaseReceiptConverts the purchase order into a Purchase Receipt.
DuplicatePurchase
DuplicatePurchaseCreates a copy of the specified purchase order.
GeneratePurchaseNumber
GeneratePurchaseNumberGenerates the next available purchase order label.
GeneratePurchasesPdfs
GeneratePurchasesPdfsGenerates PDF documents for multiple purchase orders.
Input Data Types
PurchaseInput
PurchaseInput| Field | Type | Description |
|---|---|---|
id | Int | ID for updates. |
label | String | Purchase order number. |
notes | String | Public notes. |
status | PurchaseStatus | Initial or updated status. |
update_incoming | Boolean | True if items update incoming stock. |
supplier_id | Int | Internal ID of the supplier. |
supplier | SupplierInput | Supplier data. |
line_items | [LineItemPurchaseInput] | Items list. |
dated_at | Date | Document date. |
created_at | DateTime | Creation time. |
shipping_at | Date | Expected delivery date. |
exchange_rate | Float | Exchange rate. |
total_units | Float | Total units for the purchase. |
currency | CurrencyInput | Currency data. |
orders | OrderPurchaseInput | Linked sales orders. |
manufacturing_orders | ManufacturingOrderPurchaseInput | Linked manufacturing orders. |
validation_rule_id | Int | Applied validation rule. |
external_reference | String | External reference. |
for_the_attention_of | String | Contact name on PDF. |
internal_notes | String | Private notes. |
pdf_template | PdfTemplateInput | PDF template link. |
shipping_address | AddressInput | Shipping address link. |
price_level | PriceLevelInput | Price level data. |
discount_type | DiscountType | Discount type. |
default_discount | Float | Default discount value. |
tax_type | TaxType | Tax calculation type. |
season_id | Int | Season ID. |
season | SeasonInput | Season data. |
files | [FileInput] | Attachments. |
custom_fields | [EntityCustomFieldInput] | Custom fields for this entity. |
OrderPurchaseInput
OrderPurchaseInput| Field | Type | Description |
|---|---|---|
data | [OrderInput] | Sales orders data. |
ManufacturingOrderPurchaseInput
ManufacturingOrderPurchaseInput| Field | Type | Description |
|---|---|---|
data | [ManufacturingOrderEntityIDInput] | Manufacturing order IDs to link. |
Enums
PurchaseStatus
PurchaseStatus| Value | Description |
|---|---|
unpublished | Draft status (hidden). |
draft | Document created, awaiting internal processing. |
validation | Awaiting supervisor validation. |
rejected | Document rejected by supervisor. |
active | Published and confirmed. |
completed | All items fully received and processed. |
archived | Moved to long-term storage. |
cancelled | Document voided. |
DiscountType
DiscountType| Value | Description |
|---|---|
amount | Fixed discount amount. |
percentage | Percentage-based discount. |
