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

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                          • Topic Participants

                                          • july



                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now