Request delivery
POST
{baseUrl}/deliveries
Create a new delivery booking. Include pick-up details, drop-off details, a unique customerId.
For bookings to be delivered by the Sendstack Network, select orderType: "FULFILLMENT".
For bookings to be delivered by your partners, select orderType: "PROCESSING". You can optionally assign a drop to a partner during booking. In this case, pass the assignedPartner field with the objectId of the partner.
By default, the payment for the booking is charged to your wallet, there's an optional paymentSource field for when the payment for the delivery shouldn't be deducted from your wallet.
Request Body
Name Type Description Dropoff locations and details
200 Request successfully placed 400: Bad Request {{field}} is required 422: Unprocessable Entity Low wallet balance
Copy {
id: '65fbe637eadabd3da02c3143',
trackingUrl: 'https://app.sendstack.africa/tracking?batchId=R8XB5B',
paymentStatus: 'PAID',
paymentSource: 'self',
batchId: 'R8XB5B',
totalAmount: 1500,
initiator: '65fbe629eadabd3da02c2fab',
pickup: {
address: '1894 Walker Motorway',
pickupName: 'Ramona Rowe',
pickupNumber: '+2349092264624',
pickupDate: '2024-03-22T00:00:00.000Z',
lga: 'Location 1',
state: 'Lagos'
},
drops: [
{
id: '65fbe637eadabd3da02c3141',
fulfillmentPartner: 'Sendstack',
podPaymentStatus: 'PENDING',
status: 'ASSIGNED',
trackingId: 'S1ZZ4U',
trackingUrl: 'https://app.sendstack.africa/tracking?trackingId=S1ZZ4U',
batchId: 'R8XB5B',
address: '2501 Smitham Junctions',
recipientName: 'Melinda King',
recipientNumber: '+2348099793911',
//...truncated for brevity
}
]
}
Copy {
"status": false,
"message": "Invalid app_id or app_secret",
"data": {
"statusCode": 401,
"message": "Invalid app_id or app_secret",
"isOperational": true,
}
}
Copy // Sample Request information
Url: https://sandbox.sendstack.africa/api/v1/deliveries
method: POST
Headers:
- app_id: "your app_id"
- app_secret: "your app_secret"
Sample Success Data
Copy //Sample Request Body
{
"orderType" : "FULFILLMENT" ,
"customerId" : "customerId" ,
"pickup" : {
"address" : "928 Lowe Lakes" ,
"pickupName" : "Miss Rudolph Dietrich" ,
"pickupNumber" : "+2348015793998" ,
"altPickupNumber" : "+2348015020200" ,
"pickupDate" : "2024-03-22" ,
"lat" : 6.602928 ,
"long" : 3.345006
} ,
"drops" : [
{
"address" : "419 Graham View" ,
"recipientName" : "Robyn Nitzsche DVM" ,
"recipientNumber" : "+2348007384794" ,
"altRecipientNumber" : "+2348002722212"
"lat" : 6.602928 ,
"long" : 3.345006
}
]
}
Available Fields
Copy paymentSource, //Optional
customerId, //Optional
orderType, //Optional - "PROCESSING" or "FULFILLMENT"
pickup: {
long, //Optional
lat, //Optional
locationCode, //Optional
city, //Optional
country, //Optional
address, //Required,
pickupName, //Required,
pickupEmail, //Required,
pickupNumber, //Required,
altPickupNumber, //Optional
note, //Optional
pickupDate
},
drops: [{
long, //Optional
lat, //Optional
locationCode, //Optional
address, //Required,
recipientName, //Required,
recipientNumber, //Required,
recipientEmail, //Required,
altRecipientNumber, //Required,
category: Joi.string(),
note, //Optional
country, //Optional
city, //Optional
packaging: { , //Optional
height: Joi.number(),
length: Joi.number(),
width: Joi.number(),
weight: Joi.number(),
},
categoryId, //Optional
assignedPartner //Optional,
}],
Sample Success Data(Pay on Delivery)
Copy
//Sample Request Body
{
"orderType" : "FULFILLMENT"
"customerId" : "customerId" ,
"pickup" : {
"address" : "928 Lowe Lakes" ,
"pickupName" : "Miss Rudolph Dietrich" ,
"pickupNumber" : "+2348015793998" ,
"pickupDate" : "2024-03-22" ,
"locationCode" : "JJ2M" ,
} ,
"drops" : [
{
"address" : "419 Graham View" ,
"podAmount" : 1000 ,
"recipientName" : "Robyn Nitzsche DVM" ,
"recipientNumber" : "+2348007384794" ,
"locationCode" : "XV4C" ,
}
]
}
Sample Error Data
Copy // Sample Request Body
{
"orderType" : "FULFILLMENT"
"customerId" : "customerId" ,
"pickup" : {
"pickupName" : "Miss Rudolph Dietrich" ,
"pickupNumber" : "+2348015793998" ,
"pickupDate" : "2024-03-22" ,
"locationCode" : "JJ2M" ,
} ,
"drops" : [
{
"recipientName" : "Robyn Nitzsche DVM" ,
"recipientNumber" : "+2348007384794" ,
"locationCode" : "XV4C" ,
}
]
}
Copy // Sample Response Body - 400 Bad Request
{
"status" : false ,
"message" : "\"address\" is required, \"address\" is required"
}
A 400 Bad Request is returned for any missing required field.
Last updated 6 months ago