I have encountered a problem when I tried to create a package from a template with the rest API. I used all tips and instruction I found in the documentation and on forums, but I did'nt found a solution yet. Here is one of the documentation :

Example code shows how to create a simple callback event notification listener in Node.js
Rate this Code Share
Source type
Direct file upload - File will be hosted on developer website
Hello, i'm a junior developer and it has been my second week learning Node JS so errors might be because of my poor use of Javascript. My problem is that after sending a request pretty much like in the example given on this link i get an undefined package id. I suppose this is caused by un unvalid json payload or options objet. Here is my code. The build of the json payload is done at line 23.