# When do I need to submit the package ID as part of the template id for JSON API transactions?

**URL:** <https://forum.canton.network/t/when-do-i-need-to-submit-the-package-id-as-part-of-the-template-id-for-json-api-transactions/1098>\
**Category:** App Development\
**Created:** [August 25, 2020, 2:50pm UTC](https://forum.canton.network/t/when-do-i-need-to-submit-the-package-id-as-part-of-the-template-id-for-json-api-transactions/1098 "2020-08-25T14:50:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [August 25, 2020, 2:59pm UTC](https://forum.canton.network/t/when-do-i-need-to-submit-the-package-id-as-part-of-the-template-id-for-json-api-transactions/1098/2 "2020-08-25T14:59:04Z")

</div>

You have to submit the package id if the pair `(moduleName, templateName)` is not unique among all DAML-LF packages uploaded to the ledger. I would generally recommend that you always include the package id for production applications but for testing and debugging it’s of course totally fine to omit it.

As for getting access to the package id, if you can I would recommend to use the JavaScript codegen which will automatically include this on all requests. If that is not an option for whatever reason, you can use `daml damlc inspect-jar --json .daml/dist/mydar.dar` to print out the package id. The `main_package_id` in there is the one of your current project but you also get the package id of your dependencies. If you want to extract it automatically, something like `jq` or your favorite JSON library will do the job.

---

_[View the full topic](https://forum.canton.network/t/when-do-i-need-to-submit-the-package-id-as-part-of-the-template-id-for-json-api-transactions/1098)._
