Syntax to create Books Package via API?

Syntax to create Books Package via API?

I want to create a Package from an existing Sales Order

I pass to the Packages Create function items_list the output from the Create Sales order. Here is the JSON.


  1. package_data = Map();
  2. package_data.put("package_number","Test");
  3. package_data.put("date","2017-01-11");
  4. item_map = Map();
  5. // item_map.put("so_line_item_id",1234);
  6. item_map.put("quantity",1);
  7. // line_items = list();
  8. // line_items.add(item_map);
  9. package_data.put("line_items",sales_order_data.getJSON("salesorder").getJSON("line_items"));
I get this error: {"code":4,"message":"Invalid value passed for Item ID"}

In the Package I do NOT need all line_item data (ie. custom fields), but I don't understand how to pass the Item ID into the create Package function.

Do I need to iterate through the Sales Order line items to generate a new list of items for the Package with only the parameters it requires?

      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


                                            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 WorkDrive Resources



                                                                      Zoho Campaigns Resources

                                                                        Zoho CRM Resources

                                                                        • CRM Community Learning Series

                                                                          CRM Community Learning Series


                                                                        • Tips

                                                                          Tips

                                                                        • 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