Submit a Delivery Request
Create a new delivery request to Xameel. Once the request is submitted it iwll be sent to dispatch for processing. After submitting the request you can use Get Delivery Request to track the request status.
Request
Method : POST
URI : https://core.xameel.com/api/v1/call/delivery
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 |
Body
{
"reference": "custom-id",
"origin": "Chipotle",
"originLocation": {
"lat": 24.2154784,
"long": 21.4877958
},
"originPhone" "+1234587",
"destination": "Sam Smith",
"destinationLocation": {
"lat": 24.2154784,
"long": 21.4877958
},
"destinationPhone" "+1234587",
"customDeliveryCost": 45.00,
"tax": 5.0,
"collectCash": true,
"amountToCollect": 85.00,
"paymentMethod": "cash",
"items": [
{
"item": "Apple Pie",
"description": "Original apple pie",
"price": 10.99,
"quantity": 1
},
{
"item": "Vanilla Pie",
"description": "Vanilla cream pie with banana slices",
"price": 8.99,
"quantity": 1,
"notes": "Extra banana slices"
}
]
}
Key | Required | Type | Default | Details |
---|---|---|---|---|
reference | No | String | - | A reference id that can be set to identify a delivery request |
origin | Yes | String | - | A title to describe or label the pickup locattion |
originLocation | Yes | Object | - | Object of both latitude and longitude of the pickup location |
originPhone | Yes | String | - | Contact phone for the pick up location |
lat | Yes | Double | - | The location latitude |
long | Yes | Double | - | The location longitude |
destination | Yes | String | - | A title to describe or label the drop off locattion |
destinationLocation | Yes | Object | - | Object of both latitude and longitude of the drop off location |
destinationPhone | Yes | String | - | Contact phone for the drop off location |
customerDeliveryCost | No | Float | - | A custom delivery charge to apply to the delivery as the actual charge. Value must be >= 0.00 |
tax | No | Float | - | The delivery tax 0.00 - 100.00 (%). If left empty the account set location will be used to determine the tax value. The value is entered in % format and must be >= 0 |
collectCash | No | Boolean | False | Set to true if you want the agent to collect money on delivery |
amountToCollect | No | Float | 0.00 | Speciy the amount to be collected. Value must be >= 0.00 |
paymentMethod | No | String | cash | The payment method for this request. this can be "cash" or "credit card" |
items | Yes | Array | - | An array of objects of items to be added to the delivery request. Visit add item to delivery for object properties and formatting |
Note: Only requests with payment type set to "cash" can be modified by the agent. Modifications will be reflected on the delivery total and the amount to collect.
Expected Response
Success
{
"code": 200,
"status": "success",
"message": "Delivery created successfully"
}
Failure
This response is just a sample, the content may differ based on the type of error
{
"code": 400,
"err_code": "1x00022-010",
"status": "fail",
"message": "Bad request",
"errors": [
"No client assocciated with the API found"
]
}
Code | Error | Details |
---|---|---|
400 | 1x00022-022 | Error with the provided data |
401 | 1x00022-015 | Couldn't validate the provided API data |
403 | 1x00022-155 | No authorization was provided |
403 | 1x00022-013 | Unauthorized to use the API |
500 | 1x00022-024 | Server was not able to process the request |