Purchases Mutations

CreatePurchase

Creates a new purchase order.

Parameters:

ParameterTypeDescription
inputPurchaseInput!Purchase data.

Example Query:

mutation CreatePurchase($input: PurchaseInput!) {
  CreatePurchase(input: $input) {
    ... on Purchase {
      id
      label
      status
    }
    ... on ValidationRuleWarning {
      message
      document_id
    }
  }
}

UpdatePurchase

Updates an existing purchase order.

Parameters:

ParameterTypeDescription
idInt!ID of the purchase.
inputPurchaseInput!Updated data.

DeletePurchase / DeletePurchases

Deletes one or multiple purchase orders.


ValidatePurchase / RejectPurchase

Approve or reject a purchase order in validation workflow.


TransformIntoPurchaseReceipt

Converts the purchase order into a Purchase Receipt.


DuplicatePurchase

Creates a copy of the specified purchase order.


GeneratePurchaseNumber

Generates the next available purchase order label.


GeneratePurchasesPdfs

Generates PDF documents for multiple purchase orders.


Input Data Types

PurchaseInput

FieldTypeDescription
idIntID for updates.
labelStringPurchase order number.
notesStringPublic notes.
statusPurchaseStatusInitial or updated status.
update_incomingBooleanTrue if items update incoming stock.
supplier_idIntInternal ID of the supplier.
supplierSupplierInputSupplier data.
line_items[LineItemPurchaseInput]Items list.
dated_atDateDocument date.
created_atDateTimeCreation time.
shipping_atDateExpected delivery date.
exchange_rateFloatExchange rate.
total_unitsFloatTotal units for the purchase.
currencyCurrencyInputCurrency data.
ordersOrderPurchaseInputLinked sales orders.
manufacturing_ordersManufacturingOrderPurchaseInputLinked manufacturing orders.
validation_rule_idIntApplied validation rule.
external_referenceStringExternal reference.
for_the_attention_ofStringContact name on PDF.
internal_notesStringPrivate notes.
pdf_templatePdfTemplateInputPDF template link.
shipping_addressAddressInputShipping address link.
price_levelPriceLevelInputPrice level data.
discount_typeDiscountTypeDiscount type.
default_discountFloatDefault discount value.
tax_typeTaxTypeTax calculation type.
season_idIntSeason ID.
seasonSeasonInputSeason data.
files[FileInput]Attachments.
custom_fields[EntityCustomFieldInput]Custom fields for this entity.

OrderPurchaseInput

FieldTypeDescription
data[OrderInput]Sales orders data.

ManufacturingOrderPurchaseInput

FieldTypeDescription
data[ManufacturingOrderEntityIDInput]Manufacturing order IDs to link.

Enums

PurchaseStatus

ValueDescription
unpublishedDraft status (hidden).
draftDocument created, awaiting internal processing.
validationAwaiting supervisor validation.
rejectedDocument rejected by supervisor.
activePublished and confirmed.
completedAll items fully received and processed.
archivedMoved to long-term storage.
cancelledDocument voided.

DiscountType

ValueDescription
amountFixed discount amount.
percentagePercentage-based discount.