npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shipdeo

v1.1.2

Published

Integrasion Shipping Indonesia with shipdeo,

Downloads

6

Readme

Shipdeo

Integrasion Shipping Indonesia with shipdeo,

Official Website

Courier List

Courier list is a service that displays a list of available couriers along with the courier code. The courier code will later be used when accessing the Tracking, Pricing and Order API. The following is the courier code on shipdeo:

Reguler & Cargo Courier

| code | courier name | | --------- | -------------- | | sicepat | Sicepat Ekspres| | jne | JNE Express | | ninja | Ninja Express | | sap | SAP Express | | jnt | J&T Express | | anteraja | Anteraja | | sc | Sentral Cargo | | idx | ID Express |

Instant Courier

| code | courier name | | --------- | -------------- | | gosend | GoSend | | grab | Grab Express |

Getting Started

For install our library

npm i shipdeo

Prerequisites

For API integration, we divide it into 3 stages as follows:

  1. Setup auth and master data
  2. Order API integration
  3. Webhook integration

After carrying out all the steps above, integration testing or UAT can be carried out with the Shipdeo team to ensure that the data sent to Shipdeo is appropriate. To minimize problems in the future, it is recommended to release to production after carrying out UAT with the Shipdeo team.

Get Credential Shipdeo

The following is how to get the clientId and clientSecret on the shipdeo portal.

  1. Login and access the shipdeo apps page
  2. Fill in the integration form
    • Enter the name of your webstore
    • In he platform option select Integration
    • In the courier column, select the courier you want to activate
    • Select order to use all shipdeo features on the webstore
  3. Click save and contact the shipdeo support team to activate the integration
  4. If the account is active, you can get the clientId and clientSecret on the integration details page as below

Based on the clientId and clientSecret that you have, you can request an accessToken. accessToken is a Bearer Token which will later be used as a credential to access Shipdeo Main API and accessToken will expire in 24 hours.

Auth

Service for generate accessToken, example

const { ShipdeoAuth } = require("shipdeo");

const clientId = 'yourClientID';
const clientSecret = 'yourClientSecret';
const baseAuthUrl = 'https://auth-api-development.shipdeo.com';

const client = new ShipdeoAuth(baseAuthUrl, clientId, clientSecret);

client.getToken()
  .then(token => console.log('Token:', token))
  .catch(err => console.error('Error:', err));

Auth implementation recommendations

You need to store the token on your local system for 1 day.

Ongkir

Service for get ongkir , example:

const { ShipdeoCore } = require("shipdeo");
const ShippingItemRequest = require("shipdeo/model/request/shipping-item.req");
const ShipmentRequest = require("shipdeo/model/request/shipping.req");

const accessToken = "80d7c9dd62be00ae392c8b13989eecbf00862ce5";
const baseUrl = "https://main-api-development.shipdeo.com"

const shipdeoCore = new ShipdeoCore(baseUrl, accessToken);

const item = new ShippingItemRequest({
    "value": 100000,
    "height": 11,
    "width": 11,
    "length": 11,
    "weight": 1,
    "qty": 1,
    "weight_uom": "kg",
    "dimension_uom": "cm",
    "name": "Baju Kerja",
    "description": "ini baju kerja",
    "is_wood_package": false
})
const shippingRequest = new ShipmentRequest({
    "couriers": [
        "ninja", "sicepat"
    ],
    "is_cod": false,
    "origin_subdistrict_code": "31.71.01",
    "origin_subdistrict_name": "GAMBIR",
    "origin_city_code": "31.71",
    "origin_city_name": "KOTA ADM. JAKARTA PUSAT",
    "origin_lat": -6.1737996,
    "origin_long": 106.8266873,
    "destination_subdistrict_code": "31.73.07",
    "destination_subdistrict_name": "PAL MERAH",
    "destination_city_code": "31.73",
    "destination_city_name": "KOTA ADM. JAKARTA BARAT",
    "destination_lat": null,
    "destination_long": null,
    "destination_note": "",
    "items" : [
        item
    ]
})

shipdeoCore.shipmentOngkir(shippingRequest)
  .then(data => console.log('Ongkir:', data))
  .catch(err => console.error('Error:', err));

Order

Service for Create Order

const { ShipdeoCore } = require("shipdeo");
const ItemRequest = require("shipdeo/model/request/item");
const OrderRequest = require("shipdeo/model/request/order");
const OrderTransactionRequest = require("shipdeo/model/request/order-transaction");

const order = async () => {
    try {
        const accessToken = "2949e5d484ef798e974e0884ccd261c9b88f4af5";
        const baseUrl = "https://main-api-development.shipdeo.com"

        const shipdeoCore = new ShipdeoCore(baseUrl, accessToken);
        const item = new ItemRequest({
            "value": 20000,
            "total_value": 20000, 
            "height": 11,
            "width": 11,
            "length": 11,
            "weight": 1,
            "qty": 1,
            "weight_uom": "kg",
            "dimension_uom": "cm",
            "name": "Baju Kerja",
            "description": "ini baju kerja",
            "is_wood_package": false
        })
        const orderTransaction = new OrderTransactionRequest(
            {
                "width": 30,
                "height": 10,
                "length": 10,
                "weight": 1,
                "package_category": "NORMAL",
                "package_content": "Baju Kerja",
                "coolie": 1,
                "subtotal": 20000,
                "shipping_charge": 8000,
                "fee_insurance": 0,
                "is_insuranced": false,
                "total_value": 28000,
                "total_cod": 28000,
                "discount": 0
            }
        )

        const orderRequest = new OrderRequest({
            "courier": "sicepat",
            "charge": 8000,
            "courier_service": "SIUNT",
            "is_cod": true,
            "delivery_type": "pickup",
            "delivery_time": "4/27/2024 08:31:17 PM +0000",
            "origin_subdistrict_code": "31.71.01",
            "origin_subdistrict_name": "GAMBIR",
            "origin_city_code": "31.71",
            "origin_city_name": "KOTA ADM. JAKARTA PUSAT",
            "origin_province_code": "31",
            "origin_province_name": "DKI JAKARTA",
            "origin_lat": -6.1737996,
            "origin_long": 106.8266873,
            "origin_contact_name" : "Devi",
            "origin_contact_phone" : "08200000000",
            "origin_contact_address" : "Jln Gambir",
            "origin_contact_email" : "[email protected]",
            "destination_subdistrict_code": "31.73.07",
            "destination_subdistrict_name": "PAL MERAH",
            "destination_city_code": "31.73",
            "destination_city_name": "KOTA ADM. JAKARTA BARAT",
            "destination_province_code": "31",
            "destination_province_name": "DKI JAKARTA",
            "destination_lat": null,
            "destination_long": null,
            "destination_contact_name" : "Devi2",
            "destination_contact_phone" : "08210000000",
            "destination_contact_address" : "Jln Palmerah",
            "destination_contact_email" : "[email protected]",
            "destination_note": "Deket Apotek 24",
            "delivery_note" : "jangan di banting ya",
            "items": [
                item
            ],
            "transaction": orderTransaction
        })

  
        // Function Create Order from shipdeo Core    
        const order = await shipdeoCore.orderCreate(orderRequest);
        console.log('Orders:', order);
    } catch (err) {
        console.error('Error:', err.response.data.message)
    }
}

// Running Service
order();

Note for update and cancel order can use function orderUpdate and orderRequestCancel

Order Request Pickup/Dropoff

Service for Request pickup/droff to 3pl

const { ShipdeoCore } = require("../src");
const OrderConfirmRequest = require("../src/model/request/order-confirm");

const orderConfirm = async () => {
    try {
        const accessToken = "e50fc84aa219a03f066a5c812cb1bccc04d66690";
        const baseUrl = "https://main-api-development.shipdeo.com"

        const shipdeoCore = new ShipdeoCore(baseUrl, accessToken);
       
        const orderConfirmRequest = new OrderConfirmRequest({
            "delivery_type": "pickup",
            "delivery_time": "4/30/2024 08:31:17 PM +0000",
        })
        
        // Service Request Pickup/Dropoff
        const order = await shipdeoCore.orderConfirm(
            '66306a54da4c4fce1b91c22e', 
            orderConfirmRequest
        );

        console.log('Orders:', order);
    } catch (err) {
        console.error('Error:', err.response.data.message)
    }
}

// Running Service
orderConfirm();