Accept a Grocy product event and print its label
const url = 'https://example.com/api/v1/webhook/grocy';const options = { method: 'POST', headers: {'X-API-Key': 'example', 'Content-Type': 'application/json'}, body: '{"product_id":"example","quantity":1,"type":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Event payload emitted by Grocy when a product stock event occurs.
object
Example generated
{ "product_id": "example", "quantity": 1, "type": "example"}Responses
Section titled “Responses”Successful Response
202 Accepted response body for both webhook endpoints.
object
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}
Example generated
{ "job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Validation Error