![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
topship-africa
Advanced tools
A node package to interface with the Topship.Africa API and create a shipping method for your store.
This library allows you to quickly and easily use the Topship Africa Shipping API via Node.js.
The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs. Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it.
Grab your API Key from the Topship Africa.
Do not hardcode your Topship Africa into your code. Instead, use an environment variable or some other secure means of protecting your Topship API Key. Following is an example of using an environment variable.
$ npm install topship-africa
You may also use yarn to install
$ yarn add topship-africa
The following is the minimum needed code to get Qoutes and Prices for Shipment. Use this example, and modify the to and from variables:
const { quotesAndPrices } = require("topship-africa");
quotesAndPrices(
{
shipmentDetail: {
{
senderDetails: {
cityName: "Yaba",
countryCode: "NG"
},
receiverDetails: {
cityName: "Washington",
countryCode: "US"
},
totalWeight: 4
}
}
}
);
The following is the minimum needed code to get Pickup Rate for Shipment. Use this example, and modify the to and from variables:
const { pickupRate } = require("topship-africa");
pickupRate({
input: {
senderDetail: {
addressLine1: "268, Herbert Macauly way",
addressLine2: "",
country: "Nigeria",
countryCode: "NG",
state: "Lagos",
city: "Yaba",
},
pickupDate: "2024-02-15T09:14:29.000Z",
},
});
The following is the minimum needed code to get Booked Shipment. Use this example, and modify the to and from variables:
const { getBookedShipment } = require("topship-africa");
getBookedShipment({
filter: {
take: 10,
page: 2,
},
});
The following is the minimum needed code to get Single Shipment. Use this example, and modify the to and from variables:
const { getShipmentById } = require("topship-africa");
getShipmentById("5e9f8f9f8d8f8d8f8d8f8f8f");
The following is the minimum needed code to Cancel Single Shipment. Use this example, and modify the to and from variables:
const { cancelShipmentById } = require("topship-africa");
cancelShipmentById("5e9f8f9f8d8f8d8f8d8f8f8f");
The following is the minimum needed code to Track Shipment. Use this example, and modify the to and from variables:
const { trackShipment } = require("topship-africa");
trackShipment("T619979552");
The following is the minimum needed code to get State List. Use this example, and modify the to and from variables:
const { getStates } = require("topship-africa");
getStates("NG");
The following is the minimum needed code to get City List. Use this example, and modify the to and from variables:
const { getCities } = require("topship-africa");
getCities("NG");
The following is the minimum needed code to Book a Shipment. Use this example, and modify the to and from variables:
const { saveShipment } = require("topship-africa");
saveShipment(
{
shipment: [
{
items: [
{
category:
"Appliance || BeautyProducts || Jewelry || ComputerSupplies || HomeDecor || BabySupplies || TelevisionAndEntertainment || KitchenAccessories || Furniture || Gadgets || SolarPanelsAndInverter || VehicleParts || ClothingAndTextile || SportAccessories || GymEquipment || Fashion || Furniture || Education || Drones || Document || OriginalArtwork || ArtPrints || FoodItems || Medication || Fish || Herbs || BatteryLiquidElectrical || Crayfish || Driedfish || Prawns || Otherfish || GoatMeat || CowSkin || Beef || Snail || OtherMeats || PaintingsAndDrawings || ArtifactsAndHistoricalMonuments || LaptopsAndTablets || Phones || HeadphonesOrEarphonesOrAirPods || Wristwatches || VideoGames || OtherElectronicsOrGadgets || GoldSilverAndFineJewelry || PreciousStonesAndJewels || CostumeJewelry || HerbsAndPlants || FoodstuffAndFoodProducts || Drinks || Others",
description: "Gucci Bag",
weight: 4,
quantity: 1,
value: 99,
},
],
itemCollectionMode: "DropOff || PickUp",
pricingTier: "Budget || Express || FedEx || Premium || LastMileBudget",
insuranceType: "None || Premium || Extended",
insuranceCharge: 0,
discount: 200,
shipmentRoute: "Import || Export || Domestic",
shipmentCharge: 128000,
pickupCharge: 4000,
deliveryLocation: "Lagos",
pickupId: "topship-1234",
pickupPartner: "Fez || Standard || Dellyman || Sendstack || Messenger",
valueAddedTaxCharge: 800,
senderDetail: {
name: "John Doe",
email: "john.doe@gmail.com",
phoneNumber: "08080808080",
addressLine1: "SPencer",
addressLine2: "Alagomeji",
addressLine3: "Yaba",
country: "Nigeria",
state: "Lagos",
city: "Lagos",
countryCode: "NG",
postalCode: "100001",
},
receiverDetail: {
name: "Jane Doe",
email: "jane.doe@gmail.",
phoneNumber: "070347890",
addressLine1: "Garki",
addressLine2: "Maitama",
addressLine3: "Suleja",
country: "Nigeria",
state: "Abuja",
city: "Abuja",
countryCode: "NG",
postalCode: "111000",
},
},
],
},
process.env.TOPSHIP_API_KEY
);
The following is the minimum needed code to Pay for Shipment. Use this example, and modify the to and from variables:
const { payForShipment } = require("topship-africa");
payForShipment(
{
detail: {
shipmentId: "string",
},
},
process.env.TOPSHIP_API_KEY
);
FAQs
A node package to interface with the Topship.Africa API and create a shipping method for your store.
The npm package topship-africa receives a total of 2 weekly downloads. As such, topship-africa popularity was classified as not popular.
We found that topship-africa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.