API reference
claimPrinterJobs
Lock and return some jobs in the printer queue. The server might not give you all jobs in the queue at the same time. A job will remain locked for 1 minute, during which time it will temporarily be removed from the queue. Thus, you need to print the returned jobs within one minute, and call the "finishPrinterJob" mutation to signal that the job was successfully printed. If you haven't been able to print a job when nearing the two minute mark, you should stop trying since it will go back in the queue and could be picked up by another worker. Required permission: RestaurantWrite
claimPrinterJobs(
restaurantId: ID!
printerQueueIds: [ID!]
): [PrinterJob!]Arguments
| Name | Type | Description |
|---|---|---|
restaurantId |
ID! |
|
printerQueueIds |
[ID!] |
Returns
[PrinterJob!]
Example
mutation ClaimPrinterJobs($restaurantId: ID!) {
claimPrinterJobs(restaurantId: $restaurantId) {
id
imageUrl
}
}curl https://api.thelocoapp.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LOCO_API_KEY" \
-d '{"query": "mutation { claimPrinterJobs(...) { __typename } }"}'