Skip to main content

Retrieves a single purchase order by ID

Endpoint: https://po.mimoran.com/api/v1/graphql.php

query {
purchaseOrder(id: 1) {
purchase_order_id
purchase_code
po_date
expected_date
currency
supplier_id
supplier_name
ship_to_name
ship_to_address
discount_label
discount_amount
discount_type
tax_label
tax_amount
shipping_label
shipping_amount
po_reference
po_from
parent_id
archived
status
created_at
updated_at
items {
purchase_order_product_id
product_id
variant_id
inventory_item_id
product_name
product_sku
product_supplier_sku
variant_name
product_image
qty_ordered
qty_received
cost
sales_price
discount
tax
product_from
}
invoice_numbers //list of invoice numbers entered when receiving this PO (undone receipts excluded)
receipts { //each time this PO was received (one entry per delivery)
receipt_id
purchase_order_id
purchase_code
received_date //format Y-m-d
invoice_number
invoice_date //returned exactly as entered
note
location_id
location_name
undone //true if this receipt was undone in the app
undone_at //format Y-m-d H:i:s, null if not undone
items {
purchase_order_product_id
variant_id
product_sku
qty_received //quantity received for this line in this delivery
}
}
}
}

Notes:

  • items[].qty_received is the total received for a line across all deliveries. Use receipts to see each delivery separately — e.g. a PO delivered in two parts on two invoices returns two receipts, each with its own invoice_number and quantities.
  • Receipts that were undone in the app are still returned with undone: true, so you can tell that their invoice no longer applies. They are not counted in invoice_numbers.
  • received_date is the date only (no time).