Get order location
GET /v2/post_checkout/orders/{order_id}/location
Retrieves the current location of an order while the order is being delivered to the customer. The location is returned as geographic coordinates. If you send this request while the order is not in the DELIVERING state, the response is empty.
If the remove shopper information feature is enabled, then the response has a 403 status code.
Security
| Name | In | Description |
|---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
order_id | path | string | The order ID. |
Request
None.Request examples
- cURL
- Java
- Python
- Go
curl --request GET \
--url 'https://connect.instacart.com/v2/post_checkout/orders/{order_id}/location' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'
HttpResponse<String> response = Unirest.get("https://connect.instacart.com/v2/post_checkout/orders/{order_id}/location")
.header("Accept", "application/json")
.header("Authorization", "Bearer <token>")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
headers = {
'Accept': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("GET", "/v2/post_checkout/orders/{order_id}/location", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://connect.instacart.com/v2/post_checkout/orders/{order_id}/location"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response
| Field | Type | Required | Description |
|---|---|---|---|
coordinates | Coordinates | The coordinates. |
Coordinates Object
| Field | Type | Required | Description |
|---|---|---|---|
latitude | number | The latitude. | |
longitude | number | The longitude. |
Response examples
200 Success
200Order location fetched
{
"coordinates": {
"latitude": 1,
"longitude": 1
}
}
4XX Errors
Error responses return either a single error or multiple errors.
| HTTP Code | Cause | Error Message | Error Code | Error Meta |
|---|---|---|---|---|
403 | Retailer requested to redact shopper PII | "Shopper PII" | null | Not applicable |