purchaseOrder
Requires at least one of the permissions purchase:debit_note:create, purchase:grn:create, purchase:grn:read, purchase:purchase_invoice:create or purchase:purchase_order:read.
Returns one purchase order by ID. Needs the purchase order read permission, or a permission to read or raise a document against it (GRN read or create, debit note create, purchase invoice create), and the purchase orders feature on your plan.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query PurchaseOrder($id: ID!) {
purchaseOrder(id: $id) {
id
orderNumber
supplierCode
trackingCode
creatorName
projectName
items {
id
productName
uomName
variantName
createdAt
canceledQuantity
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query PurchaseOrder($id: ID!) {\n purchaseOrder(id: $id) {\n id\n orderNumber\n supplierCode\n trackingCode\n creatorName\n projectName\n items {\n id\n productName\n uomName\n variantName\n createdAt\n canceledQuantity\n }\n }\n}",
"variables": {
"id": "id"
}
}
EOF
Variables:
{
"id": "id"
}
Response:
{
"data": {
"purchaseOrder": {
"id": "id",
"orderNumber": "string",
"supplierCode": "string",
"trackingCode": "string",
"creatorName": "string",
"projectName": "string",
"items": [
{
"id": "id",
"productName": "string",
"uomName": "string",
"variantName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"canceledQuantity": 0
}
]
}
}
}
purchaseOrder(
id: ID!
): PurchaseOrder!
Arguments
purchaseOrder.id ● ID! non-null scalar
The ID of the purchase order.
Type
PurchaseOrder object
A purchase order raised with a supplier.