question

orlandobc avatar image
orlandobc asked David Marginian Deactivated commented

(API Reference) Why bluk_item endpoint doesnt save categories?

Im trying to save multiple items but the API ignores the categories. Here's my Json:

items: {

:hidden=>false,

:available=>true,

:autoManage=>false,

:defaultTaxRates=>true,

:isRevenue=>false,

:name=>"Clover item 4",

:price=>30,

:sku=>"cvr-4",

:code=>"0011"

:options=>[],

:itemStock=>{:quantity=>7}},

{:hidden=>false,

:available=>true,

:autoManage=>false,

:defaultTaxRates=>true,

:isRevenue=>false,

:name=>"Super Item",

:price=>100,

:sku=>"SI-1",

:code=>"001100",

:categories=>[{:id=>"J09W0PGWM29HE", :name=>"Garden", :sortOrder=>0}, {:id=>"N250F8317G9NR", :name=>"Publications", :sortOrder=>0}, {:id=>"N9E265B12FB70", :name=>"Formas", :sortOrder=>0}],

:options=>[],

:itemStock=>{:quantity=>0}}



And this is the clover API response:


http_method=:post,

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

status=200,

success=true,

canceled=nil,

body=

[{:id=>"BW9Z2NQ0BF1SA",

:hidden=>false,

:available=>true,

:autoManage=>false,

:name=>"Clover item 2",

:code=>"0011",

:sku=>"cvr-3",

:price=>30,

:priceType=>"FIXED",

:defaultTaxRates=>true,

:isRevenue=>false,

:modifiedTime=>1649159702000},

{:id=>"CEQRAWB47RGCM",

:hidden=>false,

:available=>true,

:autoManage=>false,

:name=>"Clover item 4",

:code=>"0011",

:sku=>"cvr-4",

:price=>30,

:priceType=>"FIXED",

:defaultTaxRates=>true,

:isRevenue=>false,

:modifiedTime=>1649159702000},

{:id=>"VKS071SS5DG1R",

:hidden=>false,

:available=>true,

:autoManage=>false,

:name=>"Super Item",

:code=>"001100",

:sku=>"SI-1",

:price=>100,

:priceType=>"FIXED",

:defaultTaxRates=>true,

:isRevenue=>false,

:modifiedTime=>1649159702000}]


if you notice, there are no categories in the response.


Can you help me please :D


Thanks in advance





REST API
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.

orlandobc avatar image orlandobc commented ·

Json edit:

items: [

:hidden=>false,

:available=>true,

:autoManage=>false,

:defaultTaxRates=>true,

:isRevenue=>false,

:name=>"Clover item 4",

:price=>30,

:sku=>"cvr-4",

:code=>"0011"

:options=>[],

:itemStock=>{:quantity=>7}},

{:hidden=>false,

:available=>true,

:autoManage=>false,

:defaultTaxRates=>true,

:isRevenue=>false,

:name=>"Super Item",

:price=>100,

:sku=>"SI-1",

:code=>"001100",

:categories=>[{:id=>"J09W0PGWM29HE", :name=>"Garden", :sortOrder=>0}, {:id=>"N250F8317G9NR", :name=>"Publications", :sortOrder=>0}, {:id=>"N9E265B12FB70", :name=>"Formas", :sortOrder=>0}],

:options=>[],

:itemStock=>{:quantity=>0}]

0 Likes 0 ·

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

The bulk_items endpoint only considers top-level information. The categories need to be assigned via another API call - https://docs.clover.com/docs/managing-categories#managing-items-in-a-category.

4 comments
10 |2000

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

orlandobc avatar image orlandobc commented ·

Thank you much :D

What about itemStock, itemGroup attributes, and options?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ orlandobc commented ·

They will also not be saved in the bulk_items request. This post may be helpful - https://community.clover.com/questions/14204/how-to-create-itemgroup-on-clover-web-portal-and-o-1.html.

1 Like 1 ·
orlandobc avatar image orlandobc David Marginian ♦♦ commented ·

do they manage individually? i.e for each item I need to set itemStock, itemGroup, attributes, and options one by one

0 Likes 0 ·
Show more comments

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