purchaseOrderAuditLogs
Requires permission purchase:purchase_order:read.
Lists the audit trail of one purchase order: who changed it, when, and what changed. Needs the purchase order read permission 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 PurchaseOrderAuditLogs($purchaseOrderId: ID!) {
purchaseOrderAuditLogs(purchaseOrderId: $purchaseOrderId) {
id
createdAt
action
changes
deletedBy
enteredBy
user {
id
firstName
lastName
email
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query PurchaseOrderAuditLogs($purchaseOrderId: ID!) {\n purchaseOrderAuditLogs(purchaseOrderId: $purchaseOrderId) {\n id\n createdAt\n action\n changes\n deletedBy\n enteredBy\n user {\n id\n firstName\n lastName\n email\n }\n }\n}",
"variables": {
"purchaseOrderId": "id"
}
}
EOF
Variables:
{
"purchaseOrderId": "id"
}
Response:
{
"data": {
"purchaseOrderAuditLogs": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"action": "string",
"changes": {},
"deletedBy": "string",
"enteredBy": "string",
"user": {
"id": "id",
"firstName": "string",
"lastName": "string",
"email": "string"
}
}
]
}
}
purchaseOrderAuditLogs(
purchaseOrderId: ID!
): [AuditLog!]!
Arguments
purchaseOrderAuditLogs.purchaseOrderId ● ID! non-null scalar
The ID of the purchase order.
Type
AuditLog object
One entry in the audit log.