Zoho Inventory API Purchase orders

Zoho Inventory API Purchase orders

Hello,

I'm using zoho inventory API to push items as POs,
my script looks like this

record_value = Map();

record_value.put("vendor_id","4267431000000087479");

  //"item_id": 4267431000000080270,


line_items = [];
items={
 
                "name": input.Product,
                "description": "Just a sample description.",
                "item_order": 0,
                "purchase_rate": input.Cost_per_unit,
                "quantity": 1,
                "unit": "qty",
                "item_total": 244,
                "image_id": 2077500000000002000,
                "image_name": "dell.jpg",
                "image_type": "jpg"
            };
line_items.add(items);


record_value.put("line_items",input.line_items);
response = zoho.inventory.createRecord("purchaseorders","816841960",record_value);
info response;



-----------------------------------
the response error is {"code":29009,"message":"Purchase order cannot be created for a non-purchase item."}

this is because its a new item and not created in all items yet
is there any way to create and item form PO (like the option in import po you can create and add items to PO in the same time)
however i need to that using the API

if this is not possible can we create new  item and pass its line item id directly using the same script above.

thank you