# Tracked Entity Instance Creation And Enrollment	Payload Example

**URL:** <https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171>\
**Category:** Support - Assistance technique\
**Created:** [25 February 2015 12:00 UTC](https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171 "2015-02-25T12:00:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farai\_mutero\_mzansi](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/farai_mutero_mzansi/32/85_2.png) [@farai\_mutero\_mzansi](https://community.dhis2.org/u/farai_mutero_mzansi)\
**Post date:** [25 February 2015 12:00 UTC](https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171/1 "2015-02-25T12:00:51Z")

</div>

Hi Guys

I’m working on capturing some tracker data through the Web-API and I’m using the documentation here [https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html](https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html)

The payload example provided in the documentation for creating a TrackedEntityInstance (in Json) is as follows:

> **···**
>
> Farai Mutero

---

<div class="post-metadata">

**Author:** ![morten](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/morten/32/36295_2.png) [@morten](https://community.dhis2.org/u/morten)\
**Post date:** [25 February 2015 12:07 UTC](https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171/2 "2015-02-25T12:07:04Z")

</div>

I think you left something out? Also include any errors

> **···**
>
> On Wednesday, February 25, 2015, Farai Mutero [fmutero@gmail.com](mailto:fmutero@gmail.com) wrote:
> 
> > Hi Guys
> 
> > I’m working on capturing some tracker data through the Web-API and I’m using the documentation here [https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html](https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html)
> 
> > 
> 
> > The payload example provided in the documentation for creating a TrackedEntityInstance (in Json) is as follows:
> 
> > 
> 
> > –  
> > Farai Mutero
> 
> ## –
> 
> Morten

---

<div class="post-metadata">

**Author:** ![farai\_mutero\_mzansi](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/farai_mutero_mzansi/32/85_2.png) [@farai\_mutero\_mzansi](https://community.dhis2.org/u/farai_mutero_mzansi)\
**Post date:** [25 February 2015 18:04 UTC](https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171/3 "2015-02-25T18:04:44Z")

</div>

Hi Guys (Thanks Morten for the quick reply, sent out the mail too early)

I’m working on capturing some tracker data (multiple events with registration) into DHIS2 via the Web API and I’m using the documentation here : [https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html](https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html).

The payload example provided in the documentation (In Json) is as follows:

{

```
"trackedEntity": "tracked-entity-id",

"orgUnit": "org-unit-id",

"attributes": [ {

    "attribute": "attribute-id",

    "value": "attribute-value"

} ]

```

}

I’m looking for an xml example of the same? Could you kindly assist?

I’m also looking for an xml example payload for enrolling the newly Tracked Entity Instance. The Json example provided in the documentation is as follows:

{

```
"trackedEntityInstance": "ZRyCnJ1qUXS",

"program": "S8uo8AlvYMz",

"dateOfEnrollment": "2013-09-17",

"dateOfIncident": "2013-09-17"

```

}

I’m looking for the xml example of the same. Could you kindly assist?

Regards

**Farai Mutero**

Software Development Team

\*\*Health Information Systems Program (HISP) - SA

------------------------------------------------------------------------------\*\* Email: [farai@hisp.org](mailto:farai@hisp.org)

Cell: +27 84 554 8849

Skype: fmutero

Website: [http://hispsa.org](http://hispsa.org/)

> **···**
>
> On Wed, Feb 25, 2015 at 2:07 PM, Morten Olav Hansen [mortenoh@gmail.com](mailto:mortenoh@gmail.com) wrote:
> 
> > I think you left something out? Also include any errors
> > 
> > On Wednesday, February 25, 2015, Farai Mutero [fmutero@gmail.com](mailto:fmutero@gmail.com) wrote:
> > 
> > > Hi Guys
> 
> > > I’m working on capturing some tracker data through the Web-API and I’m using the documentation here [https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html](https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html)
> 
> > >
> 
> > > The payload example provided in the documentation for creating a TrackedEntityInstance (in Json) is as follows:
> 
> > >
> 
> > > –  
> > > Farai Mutero
> 
> > 
> 
> > –  
> > Morten
> 
> > –
> 
> –
> 
> Farai Mutero

---

<div class="post-metadata">

**Author:** ![morten](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/morten/32/36295_2.png) [@morten](https://community.dhis2.org/u/morten)\
**Post date:** [25 February 2015 18:07 UTC](https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171/4 "2015-02-25T18:07:33Z")

</div>

Hi Farai

Are you coming to our VN workshop? level 2-3, we will do a big workshop on integration, apps, web-api etc…

I think it might be good for you? I’m sorry, but the docs are not so good in several places… maybe fixing docs should be part of the integration workshop… i can show people how it works, its ok for single even no registration, but after that… its lacking in several places

Just write me directly with what you want, and I can guide you

> **···**
>
> On Thu, Feb 26, 2015 at 1:04 AM, Farai Mutero [fmutero@gmail.com](mailto:fmutero@gmail.com) wrote:
> 
> > Hi Guys (Thanks Morten for the quick reply, sent out the mail too early)
> 
> > 
> 
> > I’m working on capturing some tracker data (multiple events with registration) into DHIS2 via the Web API and I’m using the documentation here : [https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html](https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html).
> 
> > The payload example provided in the documentation (In Json) is as follows:
> 
> > 
> 
> > {
> 
> > ```
> > "trackedEntity": "tracked-entity-id",
> > 
> > ```
> 
> > ```
> > "orgUnit": "org-unit-id",
> > 
> > ```
> 
> > ```
> > "attributes": [ {
> > 
> > ```
> 
> > ```
> > "attribute": "attribute-id",
> > 
> > ```
> 
> > ```
> > "value": "attribute-value"
> > 
> > ```
> 
> > ```
> > } ]
> > 
> > ```
> 
> > }
> 
> > 
> 
> > I’m looking for an xml example of the same? Could you kindly assist?
> 
> > 
> 
> > I’m also looking for an xml example payload for enrolling the newly Tracked Entity Instance. The Json example provided in the documentation is as follows:
> 
> > 
> 
> > {
> 
> > ```
> > "trackedEntityInstance": "ZRyCnJ1qUXS",
> > 
> > ```
> 
> > ```
> > "program": "S8uo8AlvYMz",
> > 
> > ```
> 
> > ```
> > "dateOfEnrollment": "2013-09-17",
> > 
> > ```
> 
> > ```
> > "dateOfIncident": "2013-09-17"
> > 
> > ```
> 
> > }
> 
> > 
> 
> > I’m looking for the xml example of the same. Could you kindly assist?
> 
> > 
> 
> > Regards
> 
> > 
> 
> > 
> 
> > **Farai Mutero**
> 
> > 
> 
> > Software Development Team
> > 
> > \*\*Health Information Systems Program (HISP) - SA
> > 
> > ------------------------------------------------------------------------------\*\* Email: [farai@hisp.org](mailto:farai@hisp.org)
> > 
> > Cell: +27 84 554 8849
> > 
> > Skype: fmutero
> > 
> > Website: [http://hispsa.org](http://hispsa.org/)
> 
> –  
> Morten
> 
> On Wed, Feb 25, 2015 at 2:07 PM, Morten Olav Hansen [mortenoh@gmail.com](mailto:mortenoh@gmail.com) wrote:
> 
> > I think you left something out? Also include any errors
> > 
> > On Wednesday, February 25, 2015, Farai Mutero [fmutero@gmail.com](mailto:fmutero@gmail.com) wrote:
> > 
> > > Hi Guys
> 
> > > I’m working on capturing some tracker data through the Web-API and I’m using the documentation here [https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html](https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s37.html)
> 
> > >
> 
> > > The payload example provided in the documentation for creating a TrackedEntityInstance (in Json) is as follows:
> 
> > >
> 
> > > –  
> > > Farai Mutero
> 
> > 
> 
> > –  
> > Morten
> 
> > –
> 
> Farai Mutero
> 
> –

---

<div class="post-metadata">

**Author:** ![pmpdelcroix](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/pmpdelcroix/32/38902_2.png) [@pmpdelcroix](https://community.dhis2.org/u/pmpdelcroix)\
**Post date:** [2 March 2021 22:04 UTC](https://community.dhis2.org/t/tracked-entity-instance-creation-and-enrollment-payload-example/28171/5 "2021-03-02T22:04:21Z")

</div>

the Doc is not correct, I lost days on it  
here a paaload that work on 2.35

{“trackedEntityInstances”: [{“trackedEntityInstance”: “KwB8Q6IMgbe”, “trackedEntityType”: “EoBGArVCQ69”, “orgUnit”: “BI8X3rJHbUa”, “enrollments”: [{“enrollment”: “KwB8Q6IMgbe”, “orgUnit”: “BI8X3rJHbUa”, “status”: “COMPLETED”, “incidentDate”: “2012-09-17”, “enrollmentDate”: “2012-09-17”, “attributes”: [{“attribute”: “BRGgPOilUtC”, “value”: “TATA”},], “program”: “IR5BiEXrBD7”}], “attributes”: [{“attribute”: “g54R38QNwEi”, “value”: “51E92E21-6A1A-485B-AB96-A158CA3FE159”}]}]}  
br
