Setting product category using REST API

Hi, i’ve been using Python to try and import my Ebay products to Shopify automatically to save time on manually copying our catologue from Ebay.

I am using the API (I’m using the REST API, but happy for suggestions using GraphQL) to create a product, how can I set the product category and the category metafields in the same way I can when creating a product manually?

Currently I cannot set it and it’s blank (photo 1) and then of course leading to empty metafields. Eventhough I try define metafields on my end, it just chucks out access to this namespace and key on metafields for this resource type is not allowed. Any help is greatly appreciated

Just wondering if anyone has any further suggestions?

Hi, how do you set this up inside Shopify with existing products ? I’m not sure where to apply this code. I’m new here.. thanks