question

chetan-purohit avatar image
chetan-purohit asked james-cha Deactivated commented

Can somebody tell me the use of /v3/merchants/{mId}/tag_items API? It is not accepting any payload but that is a POST API

Hi,

I was trying to associate items with tags using V3 APIs. I found one API /v3/merchants/{mId}/tag_items for making POST calls. In the documentation itself it is just accepting merchantId, but that is a POST API, so I think it should accept some input from our side. Can somebody tell me the use of that API and how can I do association between any item and tag using V3 API?

1 comment
10 |2000 characters needed characters left characters exceeded

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

Hey Chetan,

Thank you for your patience. I'm new to Clover so I will try to help you the best I can.

Are you trying to add items to a tag?

Have you tried using: /v3/merchants/{mId}/tags/{tagId}

in the payload you can provide items associated with this tag.

Let me know how that works for you and I'll investigate what /v3/merchants/{mId}/tag_items does.

Thank you

0 Likes 0 ·

1 Answer

Jacob Abrams avatar image
Jacob Abrams answered

This is explained in the "Object associations" sections here: https://docs.clover.com/build/web-api...

Here is example JSON to POST to v3/merchants/{mId}/tag_items which will create an association between the given pre-existing items and tags:

{
  "elements": [
    {
      "item": {
        "id": "Y14B3XG93SMTE"
      },
      "tag": {
        "id": "C2RDB8FRSD56E"
      }
    },
    {
      "item": {
        "id": "9K5A5HBM831HG"
      },
      "tag": {
        "id": "C2RDB8FRSD56E"
      }
    },
    {
      "item": {
        "id": "E2YB5YMKS4E3E"
      },
      "tag": {
        "id": "A387KKE312C9F2"
      }
    }
  ]
}

To delete append ?delete=true to the URL.

10 |2000 characters needed characters left characters exceeded

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