Delivery API | SHiiP
  • Home
  • The Guide
  • Getting Started
    • Authentication
    • Request Format & Responses
    • Errors & Status Codes
    • Rate Limits
    • Wallet Funding
    • Webhook
  • API references
    • Get User Profile
    • International HsCode
    • Get Shipment Rates
    • Get Single Rate
    • Get Available Couriers
    • Book Shipment
    • Assign Shipment
    • Get All Shipments
    • Cancel Shipment
    • Track Shipment
  • Extras
    • Promotions & Discount
Powered by GitBook
On this page
  • Payload
  • Request Sample
  • Response Sample
  1. API references

Book Shipment

Collate your shipment rate and information to be booked.

The book shipment endpoint is used to submit your shipping details to the SHiiP operations team for processing. Once your shipment is booked, it is typically attended to within 30 minutes to 3 hours. Please note that this time frame may vary depending on the volume of shipments and operational surges on that particular day.

Payload

Here's the documentation for the payload in a tabular form:

Field

Type

Required

Validation Rules

Description

redis_key

string

Yes

A unique key for identifying Redis records.

user_id

Integer

Yes

The ID of the user initiating the request.

rate_id

string

Yes

A unique identifier for the rate being used.

platform

String

Yes

Must be set toweb2

Specifies the platform the request originates from.

delivery_note

string

No

Must be a string

Custom order request and instructions

Notes:

  • redis_key and rate_id must be valid UUIDs, ensuring unique, standardized formats.

  • user_id must be a positive integer, representing a valid user in the system.

  • platform must be set to web2, ensure the request comes from an allowed source.

Ensure your wallet is adequately funded before booking a shipment, as we'd be debiting you from there.

Request Sample

curl --location 'https://delivery-staging.apiideraos.com/api/v2/token/bookshipment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer Secrek Key' \
--data '{
  "redis_key": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "user_id": 96,
  "rate_id": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "platform": "web2",
  "delivery_note": "Leave at the reception in my condo"
}'
import requests
import json

url = "https://delivery-staging.apiideraos.com/api/v2/token/bookshipment"

payload = json.dumps({
  "redis_key": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "user_id": 96,
  "rate_id": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "platform": "web2",
  "delivery_note": "Leave at the reception in my condo"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer Secrek Key'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "json"
require "net/http"

url = URI("https://delivery-staging.apiideraos.com/api/v2/token/bookshipment")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer Secret Key"
request.body = JSON.dump({
  "redis_key": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "user_id": 96,
  "rate_id": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "platform": "web2",
  "delivery_note": "Leave at the reception in my condo"
})

response = https.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://delivery-staging.apiideraos.com/api/v2/token/bookshipment',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "redis_key": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "user_id": 96,
  "rate_id": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "platform": "web2",
  "delivery_note": "Leave at the reception in my condo"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer Secret Key'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer Secret Key");

const raw = JSON.stringify({
  "redis_key": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "user_id": 96,
  "rate_id": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "platform": "web2",
  "delivery_note": "Leave at the reception in my condo"
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://delivery-staging.apiideraos.com/api/v2/token/bookshipment", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://delivery-staging.apiideraos.com/api/v2/token/bookshipment"
  method := "POST"

  payload := strings.NewReader(`{
  "redis_key": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "user_id": 96,
  "rate_id": "2c89e045-3a84-4316-923a-7729edbe4e21",
  "platform": "web2",
  "delivery_note": "Leave at the reception in my condo"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer Secret Key")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Response Sample

{
    "status": false,
    "message": "The redis key field is required."
}
{
    "data": {
        "reference": "72d4iejm4lg0",
        "shipmentId": 21749,
        "code": 200,
        "status": true
    },
    "status": true,
    "message": "OK",
    "status_code": 200
}
{
    "data": [],
    "status": false,
    "message": "Invalid User ID supplied - 10",
    "status_code": 400
}
PreviousGet Available CouriersNextAssign Shipment

Last updated 5 months ago

Must be a valid string, gotten from the response (data->redis_key)

Must be a positive integer, gotten from the

Must be a valid string, gotten from the response (data->rates->courier->id)

rates
Get User Profile endpoint (id)
rates