question

01928-7325x2 avatar image
01928-7325x2 asked 01928-7325x2 answered

Adding Printer To A Tag/Label

I created a tag and wanted to add a printer to it but the printer never attached to the tag. I'm using this API call: https://www.clover.com/api_docs#!/inv...

My request body is:

{ "printers": [ { "id": "PRINTER_ID" } ] }

No error, API responded with { "id": "TAG_ID", "name": "tag-name", "items": { "elements": [] }, "printers": { "elements": [] } }

My merchant is a test merchant ('isBillable:false"). I guess I cannot add printer to a test merchant or something wrong with my request body?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthonypinto avatar image
anthonypinto answered 01928-7325x2 commented

Hi @yauri, to my knowledge you are the first person to ask about dynamically associating tags and printers. I'm afraid it hasn't been documented before now.

Because tag/printer associations are many to many, they use an association object, as described here: https://docs.clover.com/build/web-app...

Specifically you will need to make a POST to /v3/merchants/{merchantUUID}/tag_printers

Passing a body with the following format:

{
  "elements": [
    { "printer": {"id": "<printerId>"}, "tag": {"id": "<tagId>"}}
  ]
}

As with all association objects, to delete the association make the same POST call, with the same body, but include ?delete=true as a query param.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

01928-7325x2 avatar image 01928-7325x2 commented ·

Hi @Anthony,

I can confirm that your suggestion is working. I always using this page as API reference https://www.clover.com/api_docs Didn't know if there is a hidden API :)

Thanks!

0 Likes 0 ·
01928-7325x2 avatar image
01928-7325x2 answered

Another question but may not related to this issue, could you suggest me how to tag all item using one API call instead tagging one by one?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community