# Contract creation in JSON API

**URL:** <https://forum.canton.network/t/contract-creation-in-json-api/4582>\
**Category:** App Development\
**Created:** [May 20, 2022, 10:58am UTC](https://forum.canton.network/t/contract-creation-in-json-api/4582 "2022-05-20T10:58:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [May 21, 2022, 7:58am UTC](https://forum.canton.network/t/contract-creation-in-json-api/4582/4 "2022-05-21T07:58:37Z")

</div>

`allocateParty` creates a new party everytime you run it. So if you run your Daml Script multiple times you get different parties each time which sounds like that’s what’s been happening here: You’ve run it once via `initializeUser` and then once via `allocateParties` directly. I recommend to have `initializeUser` return `LedgerParties` and then only run that once. If you run it via `daml start`, you can set the `--output-file` flag via `daml start --script-option --output-file=parties.json`.

For the `Alice::…` part, you can allocate such parties via `allocatePartyWithHint … (PartyIdHint "Alice")`. The hint will be used as a prefix.

---

_[View the full topic](https://forum.canton.network/t/contract-creation-in-json-api/4582)._
