Create product API call - supplier and category?

Hi, could anyone tell me where to put Supplier and Properties in create product API endpoint ?

I currently have this python code which fills variants and then puts this array into single product:

variants.append({
            "title":variant_name,
            "sku_code":single_variant["sku"],
            "cost_price":cost_price,
            "price":price,
            "min_reorder_level":"0",
            "quantity_to_reorder":"0",
            "tax_rate":"0",
            "upc_code":"",
            "model_number":"",
            "weight_grams":"0",
            "weight_unit":"kg",
        })

body = {
        "product": {
            "title": item["item_name"],
            "product_variants_attributes": variants,
            "images_attributes": [
                {
                    "src": item["image_url"],
                    "display_position": "1"
                },
            ]
        }
    }

I would like to also put there Supplier and also Property (which has name Category) with value.
Anyone could help me ?
I am importing 8636 products from other system so dont expect me to fill this one by one in veeqo

Hi @marhyno.
Product properties and suppliers are currently not supported for product creation, unfortunately.

I’d suggest you look at a .csv export of a product with properties and a supplier from Veeqo, then iterate through the 8636 products and dynamically create a .csv file of your own and import the products that way.

Also worth noting that due to our API limits as stated here, You may run into some difficulties if you choose not to take up the suggestion mentioned above.

Hope this helps in some way.

Hi, thanks, that helps, but one question, how supplier column should look like ?
I exported this

image

but when I tried to import that again, veeqo complained he does not know those columns

Hi @marhyno.
So for the suppliers, You’ll first need to create them in Veeqo.

The supplier fields are repetitive. Meaning you’ll have the above columns specified for each supplier.
I’d suggest you create your suppliers first, then create a .csv export from Veeqo to get a further understanding of this.

Note:
When exporting, you’ll need to check “All suppliers, supplier prices and references” under “Select additional columns to include in the export”

To append a supplier to a product, the “supplier_00000_id”, “supplier_00000_name” and “supplier_00000_ref” must be populated.

When it comes to importing your .csv file into Veeqo, you’ll need to confirm mapping for each column, then for the columns that couldn’t be confirmed, You can click “include as custom field”, then confirm.

After that, your import should be successful.

For further explanation on CSV imports, we have a handy guide which you can find here.

Hope you find this useful.

Hi, thanks for fast reply, that supplier I have in excel is “Default supplier” so I dont understand why its not recognized. Btw, if I mark that supplier column as “custom field” will the veeqo logic assign that supplier to product ?

edit: no, thats not how it works, I dont see any chance assigning products to suppliers, except doing it one by one …

Hi @marhyno.
The “Default Supplier” is a little misleading. This is what we call the supplier that’s created on your Veeqo account as an example, just like how we create mock products and orders.

The reason Veeqo is not automatically confirming these columns is that the column header is not static. The headers change based on the supplier’s ID.

I have managed to create a product with suppliers myself. I have attached a .csv example file for you to take a look at, which is also the one I have used myself.

Please note that the suppliers I have in my .csv file are unique to me, and you will need to change the supplier data/columns with your own information.

Hope this helps!

Note:
Copy and paste the below code into a notepad and save it as a .csv.

sku_code,product_title,variant_title,sales_price,cost_price,brand,upc_code,image_url,country_origin_code,weight_grams,product_id,min_reorder_level,quantity_to_reorder,max_reorder_level,width,depth,height,dimensions_unit,tax_rate,estimated_delivery,tags,product_properties,variant_options,tariff_code,qty_on_hand,total_qty,total_stock_value,supplier_63127_id,supplier_63127_name,supplier_63127_cost,supplier_63127_ref,supplier_63126_id,supplier_63126_name,supplier_63126_cost,supplier_63126_ref,supplier_63094_id,supplier_63094_name,supplier_63094_cost,supplier_63094_ref
TEST_SKU,Test Supplier import,,83.33,5.5,,,https://thumbnails.veeqo.com/yHtmJstCEwkzSj2UJ8m8UN1FN488CHcxm2GYD7jHRz4/rs:fit:1000:1000/aHR0cHM6Ly92ZWVx/by1wcm9kdWN0aW9u/LXN0b3JhZ2UuczMu/YW1hem9uYXdzLmNv/bS9pbWFnZXMvMTQw/MDIwOTA2L01XUDIy/X29yaWdpbmFsLmpw/ZWc_MTYyODI0MTQ5/Mg,GB,100,,0,0,0,254,254,254,cm,20,7,,"{""test-property"":""test-property-value"",""Size"":""12""}",{},,0,10,55,63127,The Notepad Company,1,ADD A REFERENCE IF YOU WANT TO APPEND THIS SUPPLIER,63126,Lucozade Ribena,1,ADD A REFERENCE IF YOU WANT TO APPEND THIS SUPPLIER,63094,Default supplier,0,

Okay, got it, that worked. I changed IDs to IDs of my suppliers and everything worked - name, reference, cost price

Can anyone help me what could be the problem ?

image

These are my last lines, i tried changing CSV to UTF-8 also to ANSI, checked everything but still getting this error

356,Swishers Sweet Mini,Grape,1.99,1.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarillo""}",{},,,,
357,Swishers Sweet Mini,Island Bash,1.99,1.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarillo""}",{},,,,
11736,Swishers Sweet Mini,Sticky Sweets,1.99,1.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarillo""}",{},,,,
358,Swishers Sweet Mini,Sweets,1.99,1.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarillo""}",{},,,,
11963,Swishers Sweet Mini,Red Sweets,1.99,1.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarillo""}",{},,,,
359,Swishers Sweet Mini,Tropical Storm,1.99,1.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarillo""}",{},,,,
208,Liggett Green Menthol Select 100s*,Liggett Green Menthol Select 100s*,5.99,5.99,,,https://api.loyverse.com/image/1408d460-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarettes""}",{},,,,
186,100mm Cigarette Roller - ZigZag,100mm Cigarette Roller - ZigZag,6.99,6.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarette Rollers & Injectors""}",{},,,,
185,Zig Zag 78 mm*,Zig Zag 78 mm*,5.99,5.99,,,https://api.loyverse.com/image/1408d11f-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarette Rollers & Injectors""}",{},,,,
180,70mm Rolling Machine - Token (194),70mm Rolling Machine - Token (194),14.99,3.23,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarette Rollers & Injectors""}",{},,,,
177,70mm Cigarette Roller - Top,70mm Cigarette Roller - Top,4.99,4.99,,,https://api.loyverse.com/image/1408d00f-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Cigarette Rollers & Injectors""}",{},,,,
96,GL Hemp Orange CBD 1000 mg,GL Hemp Orange CBD 1000 mg,169.99,169.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""CBD""}",{},,,,
64,Welch Grape*,Welch Grape*,0.69,0.69,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Beverages""}",{},,,,
62,Powerade Fruit Punch*,Powerade Fruit Punch*,1.49,1.49,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Beverages""}",{},,,,
55,Jumex Guava Nector*,Jumex Guava Nector*,0.69,0.69,,,https://api.loyverse.com/image/1408bfba-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Beverages""}",{},,,,
3,Shirts,Shirts,11.99,11.99,,,https://api.loyverse.com/image/1408b862-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Apparel""}",{},,,,
2,HUF Socks,HUF Socks,11.99,11.99,,,,,,,0,0,0,,,,,0,,,"{""Category"":""Apparel""}",{},,,,
14888,Hats,Flat Top,11.99,11.99,,,https://api.loyverse.com/image/1408b81f-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Apparel""}",{},,,,
14889,Hats,Visor,7.99,11.99,,,https://api.loyverse.com/image/1408b81f-711e-11ea-8d93-0603130a05b8,,,,0,0,0,,,,,0,,,"{""Category"":""Apparel""}",{},,,,

Even table shows everything okay

Hi @marhyno,
Have you tried the import without that row? I cannot see any glaring issues that stand out in the example provided.

Yes, thats why is it so weird

Can you provide me with example data?
I’ll need the header row of your .csv, as well as some example product entries so I can test this on my own account.

https://www.sendspace.com/file/cll3uf

I also tried it with minimal required fields but still got the same error.
I also tried it on fresh veeqo instance

Here is the file
https://www.sendspace.com/file/84hqog

Ok I got it, so here are the details what i did:

Because my CSV was generated by python, I had somewhere None in csv. You can see below, it had no quotes around that. Veeqo has detected been confused with double quotes so he reported error with the last line, where there was no error at all.

13714,Airis M&N,XL/Kiwi Strawberry,34.3,0,"{"“Category”":None}"

Second very important point is. When you do export, export has line endings encoded with UNIX type - UNIX (LF), when you generate your CSV with python code on windows, or you change something in exported CSV and save it it automatically change line endings with Windows ecoding - Windows (CR LF). So all you have to do, is open Notepad++ and do Search & Replace, find \r\n and replace it only with \n and save it