> 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/create-order.md).

# 🛒 Create Order

Create a new delivery order in DropHub using this endpoint. You must provide the pickup/drop-off coordinates, customer and store details, and the order’s payment and pricing info.

***

#### 🔗 Endpoint

```
POST /custom-integration/orders
```

**Full URL:**

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

#### 📥 Request Body

```json
{
  "orderNumber": "ORD12345",
  "pickUpLat": 24.7136,
  "pickUpLong": 46.6753,
  "dropOffLat": 24.6877,
  "dropOffLong": 46.7128,
  "totalAmount": 85.5,
  "paymentMethod": "CASH",
  "customerName": "Mohammed Abdullah",
  "customerPhone": "+966501234567",
  "storeName": "Al Salam Store",
  "storePhone": "+966501234567",
  "currency": "SAR",
  "orderItems": [
    {
      "itemName": "Chocolate Cake",
      "quantity": 2,
      "price": 45.25
    }
  ]
}
```

***

#### 📑 Field Reference

| Field           | Type   | Required | Description                                    |
| --------------- | ------ | -------- | ---------------------------------------------- |
| `orderNumber`   | string | ✅        | Unique ID from your system to track this order |
| `pickUpLat`     | double | ✅        | Latitude of the pickup location (store)        |
| `pickUpLong`    | double | ✅        | Longitude of the pickup location               |
| `dropOffLat`    | double | ✅        | Latitude of the delivery location (customer)   |
| `dropOffLong`   | double | ✅        | Longitude of the delivery location             |
| `totalAmount`   | double | ✅        | Full value of the order                        |
| `paymentMethod` | string | ✅        | One of: CASH, CREDIT\_CARD, STC\_PAY, etc.     |
| `customerName`  | string | ✅        | Full name of the customer                      |
| `customerPhone` | string | ✅        | Customer phone (+966 format only)              |
| `storeName`     | string | ✅        | Store name                                     |
| `storePhone`    | string | ✅        | Store phone (+966 format only)                 |
| `currency`      | string | ✅        | Always "SAR" for Saudi orders                  |
| `orderItems`    | array  | ✅        | List of items in the order                     |

***

#### 🧾 Order Item Format

Each item must follow this structure:

```json
{
  "itemName": "Item name",
  "quantity": 1,
  "price": 25.00
}
```

***

#### 📤 Success Response

```json
{
  "status": "success",
  "statusCode": 200,
  "timestamp": 1753092788001,
  "message": "سيتم تعيين الطلب وإرساله عبر الويب هوك",
  "data": "seal-0D3977", // This is OrderIntegationID

}
```

#### ⚠️ Notes

* This endpoint supports full simulation in **sandbox** mode.
* `orderNumber` must be unique per client. If reused, system may reject it.
* Use correct Saudi coordinates for pickup/delivery to avoid validation errors.
