Skip to main content

Queries

  • inboundShipment — Fetch a single inbound shipment by its id.
  • inboundShipments — List inbound shipments, optionally filtered by status.
  • purchaseOrder — Fetch a single purchase order by its id, or by its purchase order number. Provide exactly one.
  • purchaseOrders — List purchase orders, optionally filtered by supplier or status.
  • supplier — Fetch a single supplier by its id.
  • suppliers — List suppliers.

Mutations

  • cancelPurchaseOrder — Cancel a purchase order, releasing it from incoming stock. Returns null if no purchase order with that id is owned by the caller. Cancelling an already-cancelled order is a no-op. Throws a 409 CONFLICT error (with an extension code of PURCHASE_ORDER_CLOSED or PURCHASE_ORDER_HAS_RECEIVED_ITEMS) if the order can no longer be cancelled.
  • createInboundShipment — Create an inbound shipment fulfilling a purchase order. Its line items are derived from that order, not supplied: when this is the order’s only shipment they mirror the order exactly, but once an order has several shipments new order lines are left unassigned and quantity changes stop propagating. Throws a 409 CONFLICT error (with an extension code of PURCHASE_ORDER_NOT_EDITABLE) if the order is closed or cancelled.
  • createPurchaseOrder — Create a purchase order. Throws a 409 CONFLICT error (with an extension code of PURCHASE_ORDER_NUMBER_TAKEN) if poNumber is already used by another order.
  • updateInboundShipment — Update an inbound shipment’s own details. Returns null if no inbound shipment with that id is owned by the caller. Its line items are set separately with updateInboundShipmentItems, and its status is derived from receiving. Throws a 409 CONFLICT error (with an extension code of SHIPMENT_ALREADY_RECEIVED) when changing the location of a shipment that has already received stock.
  • updateInboundShipmentItems — Set which units of a purchase order an inbound shipment carries, taking unallocated units from the order and returning ones no longer wanted. Returns null if the caller owns no such shipment and order. A partial allocation persists only while the order has more than one shipment; on an order with a single shipment the next order update restores the full quantity. Throws a 409 CONFLICT error (with an extension code of SHIPMENT_NOT_LINKED_TO_PURCHASE_ORDER, PRODUCT_NOT_ON_PURCHASE_ORDER, PURCHASE_ORDER_QUANTITY_EXCEEDED, or PURCHASE_ORDER_ITEM_HAS_RECEIPTS).
  • updatePurchaseOrder — Update a purchase order. Returns null if no purchase order with that id is owned by the caller. Changing items re-syncs the order’s inbound shipments: on an order with exactly one shipment the lines mirror through, and on one with several new lines are left unassigned. Throws a 409 CONFLICT error (with an extension code of PURCHASE_ORDER_NOT_EDITABLE, PURCHASE_ORDER_ITEM_HAS_RECEIPTS, or PURCHASE_ORDER_NUMBER_TAKEN) if the change conflicts with the order’s current state.

Objects

  • InboundShipment — A shipment of inventory arriving at a location, fulfilling one or more purchase orders.
  • InboundShipmentItem — A line item received (or expected) on an inbound shipment.
  • PurchaseOrder — An order placed with a supplier to restock inventory.
  • PurchaseOrderItem — A line item ordered on a purchase order.
  • Supplier — A vendor a merchant buys inventory from, with contacts and purchase orders.
  • SupplierContact — A contact person at a supplier.

Input objects

Enums

  • InboundShipmentSortKey — A field this list can be ordered by; pass to the list’s orderBy argument and pair with reverse to flip direction.
  • InboundShipmentStatus — The lifecycle status of an inbound shipment.
  • PackingMode — How a shipment line item is packed.
  • PurchaseOrderCreateStatus — The statuses a purchase order may be created in. The receiving statuses are derived from received quantities, and cancellation has its own mutation.
  • PurchaseOrderSortKey — A field this list can be ordered by; pass to the list’s orderBy argument and pair with reverse to flip direction.
  • PurchaseOrderStatus — The lifecycle status of a purchase order.
  • SupplierSortKey — A field this list can be ordered by; pass to the list’s orderBy argument and pair with reverse to flip direction.