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
  • Requests
  • Parameter
  • Request Sample
  • Response Sample
  1. API references

Cancel Shipment

Cancel shipment from the user side.

The cancel shipment endpoint notifies us of your intention to cancel a shipment, but it doesn't immediately cancel the shipment. It's important to note that canceling a shipment after it has been assigned can be more complex and may incur additional fees. Be mindful of this when initiating a cancellation request.

Requests

Parameter

The request includes a parameter called reference, where you specify the reference of the shipment you wish to cancel. For example, use the following endpoint format:

https://delivery-staging.apiideraos.com/api/v2/token/shipment/cancel/{reference}

Replace {reference} with the actual shipment reference you received after booking the shipment. This reference is required to accurately identify and process your cancellation request.

Request Sample

curl --location 'https://delivery-staging.apiideraos.com/api/v2/token/shipment/cancel/epbip57hgvo0' \
--header 'Authorization: Bearer Secret Key'
import requests

url = "https://delivery-staging.apiideraos.com/api/v2/token/shipment/cancel/epbip57hgvo0"

payload = {}
headers = {
  'Authorization': 'Bearer Secret Key'
}

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

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

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer Secret Key"

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/shipment/cancel/epbip57hgvo0',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer Secrek Key'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
const myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer Secret Key");

const requestOptions = {
  method: "GET",
  headers: myHeaders,
  redirect: "follow"
};

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

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

func main() {

  url := "https://delivery-staging.apiideraos.com/api/v2/token/shipment/cancel/epbip57hgvo0"
  method := "GET"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  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

{
    "data": null,
    "status": false,
    "message": "Shipment with reference - epbip57hgv not found",
    "status_code": 404
}
{
    "data": null,
    "status": true,
    "message": "Shipment Cancel Request sent",
    "status_code": 200
}
PreviousGet All ShipmentsNextTrack Shipment

Last updated 8 months ago