supplyCreatePurchaseOrder
Creates a new purchase order in draft status within the pre-production milestone.
Authentication
Requires authentication and the supply:create_po permission.
Behavior
- If
poNumberis not provided, a unique number will be automatically generated based on your brand's configuration. - New purchase orders are created in
draftstatus and can be edited after they are created. - If a supplier is specified and
incotermsorpaymentTermsare not provided, they will default to the supplier's configured values.
Validation Rules
- If you provide a
supplierId, the supplier must exist and belong to the specified brand. - If you provide a
contactId, you must also specify asupplierId, and the contact must belong to that supplier. - If you include
poItems, asupplierIdis required. All products must exist, belong to the brand, and be associated with the specified supplier. - The
qtyOrderedfor each item must be greater than zero.
Possible Errors
Brand not found- The specified brand does not exist.Purchase order already exists- A PO with this ID already exists for this brand.Supplier not found- The specified supplier does not exist.Supplier does not belong to this brand- The supplier belongs to a different brand.Contact requires a supplier- A contact was specified without a supplier.Contact not found- The specified contact does not exist.Contact does not belong to the specified supplier- The contact belongs to a different supplier.A supplier must be specified when adding items- Items were provided without specifying a supplier.All products must exist and belong to the brand- One or more products are invalid or belong to a different brand.Product [SKU] is not associated with the specified supplier- The product is not available from this supplier.
supplyCreatePurchaseOrder(
input: CreatePurchaseOrderInput!
): PurchaseOrder!
Arguments
supplyCreatePurchaseOrder.input ● CreatePurchaseOrderInput! non-null input
Parameters for CreatePurchaseOrder
Type
PurchaseOrder object
Represents a purchase order in the supply chain module.
Purchase orders are formal documents sent to suppliers to request materials, products, or services. They contain details about quantities, prices, delivery dates, and terms of the purchase agreement.
Core Information
- **PO Number**: Unique identifier for the purchase order
- **Status Management**: Tracks financial status and cost allocation status
- **Dates**: Issue date, expected dates, delivery dates, and payment due dates
- **Terms**: Payment terms, Incoterms, and special instructions
Relationships
Each purchase order is associated with a supplier, created by a party, and can be approved by another party. It contains multiple line items (POItems).
Status Tracking
- **Financial Status**: Tracks payment status (unpaid, partially paid, paid)
- **Cost Allocation Status**: Tracks if costs are complete or incomplete
- **Milestones**: Current milestone and status name for workflow tracking