This API helps to retrieve a collection of delivery requests.
Request
Method : GET
URI : https:
URL Variables
Key | Example | Details |
from | 2018-11-15 | A date of which delivery requests made from or after |
to | 2018-11-15 | A date of which delivery requests made on or before |
origin | Sam | A value or part of a value in the origin field |
originPhone | 9668 | A value or part of a value in the origin phone field |
destination | Burger | A value or part of a value in the destination field |
destinationPhone | 8456 | A value or part of a value in the destination phone field |
paymentMethod | cash | Specified payment method on the delivery request. Accept values: cash, credit card |
collectCash | 1 | Records where collecting cash was required on the delivery request. Accepted values: 1, 0 |
amountCollectedGreaterThan | 10.55 | Your API password generated from the user portal |
amountCollectedLessThan | 20 | Your API password generated from the user portal |
Request with filters example
https://core.xameel.com/api/v1/call/deliveries?{key}={value}&...
Header
{
"Content-Type": "application/json",
"Accept": "application/json",
"api_key": "your-api-key",
"api_aceess": "your-api-access",
"api_pass": "your-api-password"
}
Key | Required | Type | Details |
api_key | Yes | String | Your API key generated from the user portal |
api_access | Yes | String | Your API access generated from the user portal |
api_password | Yes | String | Your API password generated from the user portal |
Expected Response
Success
{
"code": 200,
"status": "success",
"message": "deliveries found",
"data": {
"current_page": 1,
"data": [
{
"uuid": "e7e966a2-8f64-4241-b643-e971367f8394",
"origin": "Albaik",
"origin_location": "{\"lat\":24.48316739335232,\"long\":39.62342909511722}",
"origin_phone": "+123",
"destination": "Eyad Khallaf",
"destination_location": "{\"lat\":24.425913138738597,\"long\":39.60282972988284}",
"destination_phone": "+1456",
"estimated_distance": 0,
"reference": null,
"api_uuid": null,
"client_uuid": "62251b90-39d9-43f8-8661-1bdf42d30180",
"payment_method": "cash",
"status": "assigned",
"assigned_to": "8dd2b5fd-eba2-449e-9bf2-4699abcfeaa1",
"assigned_at": null,
"cancelled_by": null,
"cancelled_at": null,
"cancellation_reasons": null,
"estimated_delivery_cost": 15507.6,
"custom_delivery_cost": 45,
"sub_total": 75,
"tax": 5,
"total": 78.75,
"collect_cash": 1,
"amount_to_collect": 103.72,
"amount_collected": 85,
"created_at": "2018-11-08 13:58:15",
"updated_at": "2018-11-08 17:36:04",
"deleted_at": null
},
{
"uuid": "e7e966a2-8f64-4241-b643-e971367f8392",
"origin": "Albaik",
"origin_location": "{\"lat\":24.48316739335232,\"long\":39.62342909511722}",
"origin_phone": "+123",
"destination": "Eyad Khallaf",
"destination_location": "{\"lat\":24.425913138738597,\"long\":39.60282972988284}",
"destination_phone": "+1456",
"estimated_distance": 0,
"reference": null,
"api_uuid": null,
"client_uuid": "62251b90-39d9-43f8-8661-1bdf42d30180",
"payment_method": "cash",
"status": "assigned",
"assigned_to": "8dd2b5fd-eba2-449e-9bf2-4699abcfeaa1",
"assigned_at": null,
"cancelled_by": null,
"cancelled_at": null,
"cancellation_reasons": null,
"estimated_delivery_cost": 15507.6,
"custom_delivery_cost": 45,
"sub_total": 75,
"tax": 5,
"total": 78.75,
"collect_cash": 1,
"amount_to_collect": 103.72,
"amount_collected": 85,
"created_at": "2018-11-08 13:58:15",
"updated_at": "2018-11-08 17:36:04",
"deleted_at": null
}
],
"first_page_url": "http://localhost:8000/api/v1/call/deliveries?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/v1/call/deliveries?page=1",
"next_page_url": null,
"path": "http://localhost:8000/api/v1/call/deliveries",
"per_page": 15,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
Failure
This response is just a sample, the content may differ based on the type of error
{
"code": 403,
"err_code": "1x00022-013",
"status": "fail",
"message": "Unauthorized",
"errors": [
"Unauthorized access"
]
}
Code | Error | Details |
401 | 1x00022-055 | Couldn't validate the provided API data |
400 | 1x00022-002 | No deliveries found |
403 | 1x00022-162 | Unauthorized to preform the request |