QuickStart
The Kourier API allows you to easily integrate delivery management into your platform. Follow these steps to get started:
Step 1: Obtain Your API Key
Before making any requests, you'll need to generate an API key from your Kourier dashboard.
- Log in to your Kourier account.
- Navigate to the API Keys section.
- Click Generate API Key and copy the key.
Step 2: Make Your First Request
Once you have your API key, you can start making requests. Below is an example of how to create a delivery:
Example Request
POST https://api.kourier.com/v1/deliveries
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Request Body
{
"pickup_address": "1234 Main St",
"delivery_address": "5678 Elm St",
"package_details": {
"weight": 2.5,
"description": "Books"
},
"receiver_contact": {
"name": "John Doe",
"phone": "+1234567890"
},
"amount_to_collect": 1000
}
Step 3: Track the Delivery
After creating a delivery, you can track its status by making a GET
request:
GET https://api.kourier.com/v1/deliveries/{delivery_id}/track
Authorization: Bearer YOUR_API_KEY
Response Example
{
"delivery_id": "abc123",
"status": "in_transit",
"estimated_delivery_time": "2024-09-14T15:00:00Z"
}
Step 4: Handle Errors
If something goes wrong, you'll receive an error response with details about the issue. For example:
{
"error": "Invalid request data",
"details": "pickup_address is required"
}
Now you're ready to start managing deliveries with the Kourier API!