question

mkonnekt avatar image
mkonnekt asked mkonnekt commented

V3 REST API - Get all inventory items - Some modifierGroups are returning null for modifierIds

Using the V3 REST API we are trying to return all items from a merchant (GET /v3/merchants/{mId}/items), and we are having an issue with only one merchant. The response is returning some of the modifierGroups with a null modifierIds list. In the clover UI, this merchant clearly has modifiers within the modifier groups. Can you help us figure out why this would be happening?

URL: https://www.clover.com/v3/merchants/{...token={accesstoken}&returnnullfields=true

Snippet from Response:

{
  "id": "22343ASDFS", 
  "hidden": false, 
  "itemGroup": null, 
  "name": "Meal", 
  "alternateName": "", 
  "code": "", 
  "sku": "", 
  "price": 200, 
  "priceType": "FIXED", 
  "defaultTaxRates": true, 
  "unitName": "", 
  "cost": null, 
  "isRevenue": true, 
  "stockCount": null, 
  "taxRates": {
    "elements": [ {
        "id": "ASFSDF23423SFD", 
        "lineItemRef": null, 
        "name": "Merchant Name", 
        "rate": 225000, 
        "isDefault": true
      }
    ]
  }, 
  "modifierGroups": {
    "elements": [ {
        "id": "234SFSD234SFS", 
        "name": "Drink", 
        "alternateName": null, 
        "minRequired": null, 
        "maxAllowed": null, 
        "showByDefault": true, 
        "modifierIds": null
      }, {
        "id": "234SDFS234", 
        "name": "Your sides", 
        "alternateName": null, 
        "minRequired": null, 
        "maxAllowed": null, 
        "showByDefault": true, 
        "modifierIds": "ASDFSDF2342342,SDFSD23423423,234234SFSDFSDF,23423SDFSDF,234234SDFSDF,23423423SDFSDF,23423423SDFSDFSDF,"
      }, {
        "id": "SDFSDF234234234", 
        "name": "Condiments", 
        "alternateName": null, 
        "minRequired": null, 
        "maxAllowed": null, 
        "showByDefault": true, 
        "modifierIds": null
      }
    ]
  }, 
  "itemStock": null, 
  "modifiedTime": 1433891360000

Thanks!

Inventory
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.

mkonnekt avatar image mkonnekt commented ·

@jacobabrams can you please look into this - this looks like a bug on Clover side.

0 Likes 0 ·

1 Answer

anthonypinto avatar image
anthonypinto answered

Our system uses the modifierIds field to track the sort order of the modifiers within a modifier group, i.e. the order in which the modifiers are displayed in the UI. As such, it may not always be populated.

You can use an expansion to access the full modifiers list:

/v3/merchants/{mUUID}/modifier_groups?expand=modifiers

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