question

orlandobc avatar image
orlandobc asked David Marginian Deactivated answered

When creating an inventory item, the item name is ignored when it is a variant (has an item group).

Hi there,

I'm creating Items with: https://docs.clover.com/reference/inventorycreateitem

but if I send an item group id it takes the item group name instead of the item this is my payload:

{

:name=>"IPhone 12 White 64G", // This is ignored

:price=>39900,

:sku=>"IP-White-64-GB",

:itemGroup=>{

:id=>"EK91XPRJMVSE0"

}

}

This is the endpoint response:

http_method=:post,

url="https://sandbox.dev.clover.com/v3/merchants/ECFVTW74B0K01/items",

status=200,

success=true,

canceled=nil,

body=

{:id=>"HGD8FD68KW73R",

:hidden=>false,

:available=>true,

:autoManage=>false,

:itemGroup=>{:id=>"EK91XPRJMVSE0"},

:name=>"IPhone 12", // name of the item group, not the variant's name I just sent it

:sku=>"IP-White-64-GB",

:price=>39900,

:priceType=>"FIXED",

:defaultTaxRates=>true,

:isRevenue=>true,

:modifiedTime=>1649753403000},

name=:item_create,

error=nil>


Is this normal behavior, because I need to save the variant name instead of the item group name?

Thanks in advance




REST API
10 |2000

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

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered

https://docs.clover.com/reference/inventorygetitemgroups

The name of an item which is a member of an item group is automatically generated by the Clover server as a combination of the item group name and the name of all the options associated with that item. It cannot be changed. If the item group name is changed, or if an option name is changed, then the item names will be automatically regenerated.
10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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