# Track Delivery Status

## Track Delivery Status

<mark style="color:blue;">`GET`</mark> `{baseUrl}/deliveries/track`

Track the status and get details of a delivery using the batch ID or tracking ID

#### Query Parameters

| Name       | Type   | Description                            |
| ---------- | ------ | -------------------------------------- |
| batchId    | string | The batch ID of the delivery request   |
| trackingId | string | The tracking ID of a specific delivery |

#### Headers

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark>     | String |             |
| app\_secret<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 Delivery details retrieved." %}

```json
{
  "status": true,
  "message": "Deliveries successfully retrieved",
  "data": {
    "id": "65fc04820686cd2854e20bf0",
    "trackingUrl": "https://app.sendstack.africa/tracking?batchId=OLN9HI",
    "paymentStatus": "PAID",
    "paymentSource": "self",
    "messageDropAfterPickup": false,
    "batchId": "OLN9HI",
    "initiator": "65fc04750686cd2854e20a92",
    "isSameDayDelivery": false,
    "hasLockerBooking": false,
    "totalAmount": 1500,
    "manager": {
      "id": "65fc04750686cd2854e20a92",
      "name": "Ginger Dibbert",
      "email": "makayla_corwin15@gmail.com"
    },
    "pickup": {
      "address": "8504 Collier Plaza",
      "locationCode": "01",
      "pickupName": "Karen Casper",
      "pickupNumber": "+2348010988866",
      "pickupDate": "2024-03-22T00:00:00.000Z",
      "state": "Lagos",
      "zone": "zone_1",
      "lga": "Location 1",
      "long": 3.345006,
      "lat": 6.602928
    },
    "drops": [
      {
        "id": "65fc07e59d2de436cc08b56a",
        "trips": [],
        "processed": true,
        "customFields": { 
            "pickup": {
                "pickup_house_number": 1
            },
            "drop": {
                "dropoff_house_number": 2
            }
         }
        //...truncated for brevity
      }
    ],
    "createdAt": "2024-03-21T09:57:22.070Z"
  }
}

```

{% endtab %}

{% tab title="400 Invalid batchId or trackingId" %}

```
{
    "status": false,
    "message": "Delivery details not found",
    "data": {}
}
```

{% endtab %}
{% endtabs %}

### Sample Success Data

```
// Sample Request Information
Url: https://sandbox.sendstack.africa/api/v1/deliveries/track?batchId={{batchId}}&trackingId={{trackingId}}
NB: Replace {{batchId}} and {{trackingId}} with their respective string values
Method: GET
Headers: 
 - app_id: "your app_id"
 - app_secret: "your app_secret"
```

```json
//Sample Response Body - 200 OK
{
  "status": true,
  "message": "Deliveries successfully retrieved",
  "data": {
    "id": "65fc04820686cd2854e20bf0",
    "trackingUrl": "https://app.sendstack.africa/tracking?batchId=OLN9HI",
    "paymentStatus": "PAID",
    "paymentSource": "self",
    "messageDropAfterPickup": false,
    "batchId": "OLN9HI",
    "initiator": "65fc04750686cd2854e20a92",
    "isSameDayDelivery": false,
    "hasLockerBooking": false,
    "totalAmount": 1500,
    "manager": {
      "id": "65fc04750686cd2854e20a92",
      "name": "Ginger Dibbert",
      "email": "makayla_corwin15@gmail.com"
    },
    "pickup": {
      "address": "8504 Collier Plaza",
      "locationCode": "01",
      "pickupName": "Karen Casper",
      "pickupNumber": "+2348010988866",
      "pickupDate": "2024-03-22T00:00:00.000Z",
      "state": "Lagos",
      "zone": "zone_1",
      "lga": "Location 1",
      "long": 3.345006,
      "lat": 6.602928
    },
    "drops": [
      {
        "id": "65fc07e59d2de436cc08b56a",
        "trips": [],
        "processed": true,
        //...truncated for brevity
      }
    ],
    "createdAt": "2024-03-21T09:57:22.070Z"
  }
}

```

### Sample Error Data

```
// Sample Request Information
Url: https://sandbox.sendstack.africa/api/v1/deliveries/track?batchId=invalidBatchId&trackingId=invalidTrackingId
Method: GET
Headers: 
 - app_id: "your app_id"
 - app_secret: "your app_secret"
```

```json
//Sample Response Body - 400 Bad Request
{
    "status": false,
    "message": "Invalid batchId or trackingId"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sendstackhq.com/delivery-api/status-tracking/track-delivery-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
