appCreateGrn
Requires permission purchase:grn:create.
Record goods received against an approved purchase order from an installed app. Each line names its purchase order line and the quantities; the cost, tax and discount come from that line, and the server sets currency, rate and dates. Stock is posted for the accepted units. Needs write_purchasing.
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 AppCreateGrn($input: AppCreateGrnInput!) {
appCreateGrn(input: $input) {
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 AppCreateGrn($input: AppCreateGrnInput!) {\n appCreateGrn(input: $input) {\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": {
"input": {
"lines": [
{
"purchaseOrderItemId": "id",
"receivedQuantity": 0
}
]
}
}
}
EOF
Variables:
{
"input": {
"lines": [
{
"purchaseOrderItemId": "id",
"receivedQuantity": 0
}
]
}
}
Response:
{
"data": {
"appCreateGrn": {
"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"
}
}
}
}
appCreateGrn(
input: AppCreateGrnInput!
): GRN!
Arguments
appCreateGrn.input ● AppCreateGrnInput! non-null input
The goods receipt.
Type
GRN object
A goods receipt note: goods received from a vendor into a warehouse, usually against a purchase order.