updateGRN
Requires permission purchase:grn:update.
Changes a goods receipt. A GRN that has reached a final status cannot have its status changed again, one already posted cannot be linked to a different purchase order, and once it has posted stock its lines cannot be changed: correct it with an inventory adjustment or a purchase return. Lines already billed on a purchase invoice cannot be edited, and the currency must still match the purchase order. Needs the goods receipt (GRN) 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
mutation UpdateGRN($updateGRNInput: UpdateGRNInput!) {
updateGRN(updateGRNInput: $updateGRNInput) {
id
grnNumber
vehicleNumber
driverName
status
createdAt
inspector {
id
firstName
lastName
email
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateGRN($updateGRNInput: UpdateGRNInput!) {\n updateGRN(updateGRNInput: $updateGRNInput) {\n id\n grnNumber\n vehicleNumber\n driverName\n status\n createdAt\n inspector {\n id\n firstName\n lastName\n email\n }\n }\n}",
"variables": {
"updateGRNInput": {
"id": "id"
}
}
}
EOF
Variables:
{
"updateGRNInput": {
"id": "id"
}
}
Response:
{
"data": {
"updateGRN": {
"id": "id",
"grnNumber": "string",
"vehicleNumber": "string",
"driverName": "string",
"status": "string",
"createdAt": "2025-01-15T00:00:00Z",
"inspector": {
"id": "id",
"firstName": "string",
"lastName": "string",
"email": "string"
}
}
}
}
updateGRN(
updateGRNInput: UpdateGRNInput!
): GRN!
Arguments
updateGRN.updateGRNInput ● UpdateGRNInput! non-null input
The goods receipt note fields to change.
Type
GRN object
A goods receipt note: goods received from a vendor into a warehouse, usually against a purchase order.