Skip to content

Accept a Grocy product event and print its label

POST
/api/v1/webhook/grocy
curl --request POST \
--url https://example.com/api/v1/webhook/grocy \
--header 'Content-Type: application/json' \
--header 'X-API-Key: example' \
--data '{ "product_id": "example", "quantity": 1, "type": "example" }'

Receives a Grocy webhook event for a product stock change and prints the product label through the print queue, like POST /api/v1/print. Requires the X-API-Key header — returns 503 when the key is not configured, 401 when the key is wrong, 422 when required payload fields are missing and 429 above the per-key rate limit. Printer and lookup errors (no tape, printer disabled or offline, integration failed) are answered as by POST /api/v1/print (409/422/502/503); an unknown spool or product answers 404 app-lookup-not-found and an integration that is not configured 503 integration_not_configured (both in the problem-detail body shape). Nothing is queued. On success returns 202 with the new job’s UUID; the queue worker prints it. One label is printed; quantity is accepted but not printed.

X-API-Key
required
X-Api-Key
string
Media typeapplication/json
GrocyWebhookPayload

Event payload emitted by Grocy when a product stock event occurs.

object
product_id
required
Product Id

Grocy product identifier

string
quantity
Quantity

Optional stock quantity delta. Accepted, not printed yet (see #284)

Any of:
number
type
required
Type

Event type string (e.g. ‘stock_added’, ‘stock_removed’)

string

Example generated

{
"product_id": "example",
"quantity": 1,
"type": "example"
}

Successful Response

Media typeapplication/json
WebhookAcceptedResponse

202 Accepted response body for both webhook endpoints.

object
job_id
required
Job Id

UUID of the new print job. Webhook jobs have no owner: an admin or SSO caller can follow it under GET /api/v1/jobs/{job_id}

string format: uuid

Example generated

{
"job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Validation Error

Media typeapplication/json
object
detail
required
object
error_code
required
string
error_detail
Any of:
object
key
additional properties
any
error_message
required
string

Example generated

{
"detail": {
"error_code": "example",
"error_detail": {},
"error_message": "example"
}
}