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

# 📦 Check Delivery Price

Use this endpoint to calculate the estimated delivery fee between a pickup and drop-off location. The system returns the price based on distance and internal pricing logic.

Use this endpoint to calculate the estimated delivery fee between a pickup and drop-off location. The system returns the price based on distance and internal pricing logic.

***

#### 🔗 Endpoint

```
POST /custom-integration/check-price
```

**Full URL:**

```
https://api.drop-hub.com/api/custom-integration/check-price
```

***

#### 🔐 Authentication Required

Include your API key in the request header:

```
x-api-key: your-api-key
```

***

#### 📥 Request Headers

| Header         | Value              | Required |
| -------------- | ------------------ | -------- |
| `x-api-key`    | your-api-key       | ✅        |
| `Content-Type` | `application/json` | ✅        |
| `Accept`       | `application/json` | ✅        |

***

#### 📤 Request Body

```json
Edit{
  "pickupLatitude": 24.7136,
  "pickupLongitude": 46.6753,
  "destinationLatitude": 24.7743,
  "destinationLongitude": 46.7386
}
```

| Field                  | Type  | Description                           | Required |
| ---------------------- | ----- | ------------------------------------- | -------- |
| `pickupLatitude`       | float | Latitude of the pickup location       | ✅        |
| `pickupLongitude`      | float | Longitude of the pickup location      | ✅        |
| `destinationLatitude`  | float | Latitude of the destination location  | ✅        |
| `destinationLongitude` | float | Longitude of the destination location | ✅        |

***

#### ✅ Example Response

```json
{
  "status": "success",
  "statusCode": 200,
  "timestamp": 1753091232990,
  "message": "تمت العملية بنجاح",
  "data": {
    "price": 22.0,
    "distanceKm": 16.1007,
    "estimatedDeliveryTimeMinutes": 18,
    "currency": "SAR"
  }
}
```

| Field                          | Type   | Description                                  |
| ------------------------------ | ------ | -------------------------------------------- |
| `price`                        | float  | Calculated delivery price                    |
| `distanceKm`                   | float  | Distance between pickup and destination (km) |
| `estimatedDeliveryTimeMinutes` | int    | Estimated delivery time in minutes           |
| `currency`                     | string | Currency of the price (always "SAR")         |

***

#### ❌ Error Response Example (Different Region)

```json
{
    "status": "error",
    "statusCode": 400,
    "errorKey": "SY-1000",
    "timestamp": 1753091371789,
    "message": "الطلب بعيد جدا"
}
```
