> For the complete documentation index, see [llms.txt](https://docs.sendstackhq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sendstackhq.com/delivery-api/estimates/get-delivery-price.md).

# Get Delivery Price Estimate

## Get Delivery Price

<mark style="color:green;">`POST`</mark> `{baseUrl}/deliveries/offers`

This endpoint provides a price estimate for deliveries between two locations. You can use one of the following methods to specify locations:

1. **Location Code:**\
   Pass a `locationCode` for both the pickup and drop-off locations. Location codes can be retrieved via the [Get Locations](/delivery-api/locations/get-delivery-locations.md) endpoint.
2. **Latitude and Longitude:**\
   Provide `lat` and `long` values within the pickup and drop-off objects.

#### Required Details for Price Estimate:

* **orderType:** Set to `PROCESSING`
* **Pick-up Details:** Include all relevant information for the pickup location.
* **Drop-off Details:** Include all relevant information for the drop-off location.

#### Request Body

| Name      | Type   | Description     |
| --------- | ------ | --------------- |
| orderType | string |                 |
| pickup    | object | pickup details  |
| drop      | object | dropoff details |

**pickup object**

| Field        | Description                                                             | Data Type | Constraints |
| ------------ | ----------------------------------------------------------------------- | --------- | ----------- |
| long         | Longitude of specified pickup address                                   | Number    | Optional    |
| lat          | Latitude of specified pickup address                                    | Number    | Optional    |
| locationCode | Maps to an area, local government, or province connected to the address | String    | Optional    |
| city         | Pickup city                                                             | String    | Optional    |
| state        | Pickup state                                                            | String    | Optional    |
| country      | Pickup country                                                          | String    | Optional    |
| address2     | Alternative pickup address                                              | String    | Optional    |
| address      | Pickup address                                                          | String    | Optional    |
| postalCode   | Pickup address postal code                                              | String    | Optional    |
| pickupDate   | The date scheduled for the pickup                                       | String    | Optional    |

**Drop object**

| Field        | Description                                                             | Data Type | Constraints |
| ------------ | ----------------------------------------------------------------------- | --------- | ----------- |
| long         | Longitude of specified drop address                                     | Number    | Optional    |
| lat          | Latitude of specified drop address                                      | Number    | Optional    |
| locationCode | Maps to an area, local government, or province connected to the address | String    | Optional    |
| city         | drop city                                                               | String    | Optional    |
| state        | drop state                                                              | String    | Optional    |
| country      | drop country                                                            | String    | Optional    |
| address2     | Alternative drop address                                                | String    | Optional    |
| address      | drop address                                                            | String    | Optional    |
| postalCode   | drop address postal code                                                | String    | Optional    |
| width        | Width of the package (cm)                                               | Number    | Optional    |
| length       | Length of the package (cm)                                              | Number    | Optional    |
| height       | Height of the package (cm)                                              | Number    | Optional    |
| weight       | Weight of the package (kg)                                              | Number    | Optional    |
| category     | category of item                                                        | String    | Optional    |
| podAmount    | Proof of delivery amount                                                | Number    | Optional    |

{% tabs %}
{% tab title="200 Delivery estimate successfully generated" %}

```
{
    "status": true,
    "message": "Available Delivery Offers Returned",
    "data": [
        {
            "name": "DLVR By Sendstack",
            "price": 3200,
            "id": "657217b5901fd21b282399ca",
            "partnerLogo": "https://sendstack.s3.us-west-2.amazonaws.com/partnerDocuments/65bcd97c1e38ed2e78e78e93/supportingDocument/be48d753-075c-4611-9c0a-52ebe8e2b270.png",
            "deliveryTimeline": {
                "estimatedDropoffWindow": {
                    "start": "2024-04-26T13:00:00.000Z",
                    "end": "2024-04-26T18:00:00.000Z"
                },
                "estimatedPickupWindow": {
                    "start": "2024-04-26T07:00:00.000Z",
                    "end": "2024-04-26T13:00:00.000Z"
                }
            },
            "scope": "intracity_scheduled",
            "createdAt": "2024-04-25T16:40:18+01:00"
        }
    ]
}
```

{% endtab %}

{% tab title="400 pickupDate is required" %}

```
{
    "status": false,
    "message": "\"dropoffCode\" is required",
    "data": {
        "statusCode": 400,
        "message": "\"dropoffCode\" is required",
    }
}
```

{% endtab %}
{% endtabs %}

### Sample Success Data using location code

```json
{
    "orderType": "PROCESSING",
    "pickup": {
        "pickupDate": "2024-04-26", //optional
        "locationCode": "0NUP",
        "city": "Ikeja",
        "state": "Lagos",
        "address": "30, Allen Avenue, Ikeja",
        "address2": "5, Allen Avenue, Ikeja"
    },
    "drop": {
        "locationCode": "OHZ2",
        "city": "Yaba",
        "state": "Lagos",
        "address": "7, Adebiyi Street, Yaba",
        "address2": "10, Adebiyi Street, Yaba",
        "category": "Electronic",
        "width": 5,
        "height": 5,
        "weight": 5,
        "length": 5
    }
}
```

```json
{
    "orderType": "PROCESSING",
    "pickup": {
        "pickupDate": "2024-04-27", //optional
        "locationCode": "0NUP",
        "city": "Ikeja", //optional
        "state": "Lagos", //optional
        "address": "30, Allen Avenue, Ikeja",
        "address2": "5, Allen Avenue, Ikeja"
    },
    "drop": {
        "locationCode": "OHZ2",
        "city": "Yaba", //optional
        "state": "Lagos", //optional
        "address": "7, Adebiyi Street, Yaba",
        "address2": "10, Adebiyi Street, Yaba",
        "category": "Electronic",
        "width": 5,
        "height": 5,
        "weight": 5,
        "length": 5
    }
}
```

```json
// Sample Response Body - 200 OK
{
    "status": true,
    "message": "Available Delivery Offers Returned",
    "data": [
        {
            "name": "DLVR By Sendstack",
            "price": 3200,
            "id": "657217b5901fd21b282399ca",
            "partnerLogo": "https://sendstack.s3.us-west-2.amazonaws.com/partnerDocuments/65bcd97c1e38ed2e78e78e93/supportingDocument/be48d753-075c-4611-9c0a-52ebe8e2b270.png",
            "deliveryTimeline": {
                "estimatedDropoffWindow": {
                    "start": "2024-04-26T13:00:00.000Z",
                    "end": "2024-04-26T18:00:00.000Z"
                },
                "estimatedPickupWindow": {
                    "start": "2024-04-26T07:00:00.000Z",
                    "end": "2024-04-26T13:00:00.000Z"
                }
            },
            "scope": "intracity_scheduled",
            "createdAt": "2024-04-25T16:40:18+01:00"
        }
    ]
}
```

### Sample Success Data using lat and long

```
{
    "orderType": "PROCESSING",
    "pickup": {
        "pickupDate": "2024-10-19",
        "lat": 6.60398,
        "long": 3.351345,
        "city": "Ikeja",
        "state": "Lagos",
        "address": "30, Allen Avenue, Ikeja"
    },
    "drop": {
        "lat": 6.514299,
        "long": 3.368903,
        "city": "Yaba",
        "state": "Lagos",
        "address": "7, Adebiyi Street, Yaba",
        "width": 5,
        "height": 5,
        "weight": 5,
        "length": 5
    }
}
```

### Sample Sucess response

```
{
  "status": true,
  "message": "Available Delivery Offers Returned",
  "data": [
    {
      "name": "test",
      "offerName": "test",
      "price": 0,
      "id": "665064a7637d793b04a2f5a7",
      "deliveryTimeline": {
        "estimatedPickupWindow": {
          "start": "2024-10-19T06:00:00.000Z",
          "end": "2024-10-19T10:00:00.000Z"
        },
        "estimatedDropoffWindow": {
          "start": "2024-10-19T10:00:00.000Z",
          "end": "2024-10-19T18:00:00.000Z"
        }
      },
      "pickupDate": "2024-10-19",
      "scope": "intracity_scheduled",
      "isApiPartner": false,
      "serviceCharge": 200,
      "createdAt": "2024-10-18T15:32:45+00:00"
    },
    {
      "name": "DLVR By Sendstack",
      "offerName": "DLVR By Sendstack",
      "price": 2500,
      "id": "657217b5901fd21b282399ca",
      "deliveryTimeline": {
        "estimatedPickupWindow": {
          "start": "2024-10-19T06:00:00.000Z",
          "end": "2024-10-19T10:00:00.000Z"
        },
        "estimatedDropoffWindow": {
          "start": "2024-10-19T10:00:00.000Z",
          "end": "2024-10-19T18:00:00.000Z"
        }
      },
      "pickupDate": "2024-10-19",
      "scope": "intracity_scheduled",
      "isApiPartner": false,
      "longDistance": false,
      "serviceCharge": 200,
      "createdAt": "2024-10-18T15:32:45+00:00"
    },
    {
      "name": "Messenger",
      "offerName": "Messenger",
      "price": 2700,
      "id": "6568795e0197e613544aaaca",
      "deliveryTimeline": {
        "estimatedDropoffWindow": {
          "start": "2024-10-19T10:00:00.000Z",
          "end": null
        },
        "estimatedPickupWindow": {
          "start": "2024-10-19T06:00:00.000Z",
          "end": null
        }
      },
      "express": true,
      "pickupDate": "2024-10-19",
      "scope": "intracity_scheduled",
      "isApiPartner": true,
      "serviceCharge": 200,
      "createdAt": "2024-10-18T15:32:45+00:00"
    }
  ]
}
```

### Sample Error Data

```json
{
    "orderType": "PROCESSING",
    "pickup": {
        "pickupDate": "2024-04-26",
        "city": "Ikeja",
        "state": "Lagos",
        "address": "30, Allen Avenue, Ikeja",
        "address2": "5, Allen Avenue, Ikeja"
    },
    "drop": {
        "city": "Yaba",
        "state": "Lagos",
        "address": "7, Adebiyi Street, Yaba",
        "address2": "10, Adebiyi Street, Yaba",
        "category": "Electronic",
        "width": 5,
        "height": 5,
        "weight": 5,
        "length": 5
    }
}
```

```json
// Sample Response Body - 400 Bad Request
{
    "status": false,
    "message": "Pickups in Lagos or Intra-city deliveries must include lat/long or locationCode"
}
```
