# Possible to include ID's with coordinates in "directions"?

**URL:** <https://ask.openrouteservice.org/t/possible-to-include-ids-with-coordinates-in-directions/558>\
**Category:** openrouteservice\
**Created:** [May 21, 2019, 11:21am UTC](https://ask.openrouteservice.org/t/possible-to-include-ids-with-coordinates-in-directions/558 "2019-05-21T11:21:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xoam](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/x/b9bd4f/32.png) [@xoam](https://ask.openrouteservice.org/u/xoam)\
**Post date:** [May 21, 2019, 11:21am UTC](https://ask.openrouteservice.org/t/possible-to-include-ids-with-coordinates-in-directions/558/1 "2019-05-21T11:21:19Z")

</div>

Hello

I’ve used PHP to automatically generate a geojson file. This works, however, I want to use the feedback I get to update delivery times, but for that, I need to be able to include the order number with the coordinates, or find another way to identify which coordinate is which order.

The coords I pass along are e.g.  
{“coordinates”:[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]]}

Is it possible to include ID’s here? Like  
{“coordinates”:[1 =\> [8.681495,49.41461], 3=\> [8.686507,49.41943],6 =\>[8.687872,49.420318]]}

Or any other way to identify them later? If the coordinates themselves would be included in the response (the segments), then I could use those.

Code used (not very relevant):

function getOpenrouteserviceDirections($apiKey, $coordsString){  
// openrouteservice  
$ch = curl\_init();  
curl\_setopt($ch, CURLOPT\_URL, “[https://api.openrouteservice.org/v2/directions/driving-car/geojson](https://api.openrouteservice.org/v2/directions/driving-car/geojson)”);  
curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, TRUE);  
curl\_setopt($ch, CURLOPT\_HEADER, FALSE);  
curl\_setopt($ch, CURLOPT\_POST, TRUE);  
curl\_setopt($ch, CURLOPT\_POSTFIELDS, ‘{“coordinates”:[’.$coordsString.’]}’);

curl\_setopt($ch, CURLOPT\_HTTPHEADER, array(  
“Content-Type: application/geo+json”,  
“Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8”,  
“Authorization: {$apiKey}”  
));

$directions = curl\_exec($ch);  
curl\_close($ch);

return $directions;  
}

---

<div class="post-metadata">

**Author:** ![nils](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/nils/32/6_2.png) [@nils](https://ask.openrouteservice.org/u/nils)\
**Post date:** [May 21, 2019, 12:24pm UTC](https://ask.openrouteservice.org/t/possible-to-include-ids-with-coordinates-in-directions/558/2 "2019-05-21T12:24:55Z")

</div>

Use the `id` field in the request parameters:

[https://openrouteservice.org/dev/#/api-docs/v2/directions/{profile}/geojson/post](https://openrouteservice.org/dev/#/api-docs/v2/directions/%7Bprofile%7D/geojson/post)

Also, the response _does_ contain the coordinates, in the `metadata` field.
