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

lazada-open-api-package

v1.0.5

Published

Generate "signature", "signature by url" and more for Lazada Open Platform.

Downloads

33

Readme

lazada-open-api Logo

Generate "signature", "signature by url" and more for Lazada Open Platform.

NPM Version

I am very happy and grateful for everyone's help. These meaningful contributions will greatly help me in expanding the useful library to help people.

Paypal: https://paypal.me/tudinhacoustic

Content

  1. Installation
  2. Features
  3. Community
  4. Generate Signature using Url
  5. Generate Signature
  6. Generate Timestamp
  7. Generate Token using Auth Code
  8. Generate Token using Refresh Token

Installation

Installation is done using the npm install command:

$ npm install lazada-open-api-package

Back

Features

  • Generate Signature using Url
  • Generate Signature
  • Generate Timestamp
  • Generate Token using Auth Code
  • Generate Token using Refresh Token

Back

Community

Back

Generate Signature using Url

const lazadaOpenApi = require('lazada-open-api-package')

// Example Url.
// The package helps remove the "sign", and the "time" has been decoded.
const url = 'https://api.lazada.vn/rest/orders/get?sort_direction=DESC&offset=0&created_before=2023-10-18T23%3A59%3A59%2B07%3A00&created_after=2023-10-18T00%3A00%3A01%2B07%3A00&limit=10&sort_by=created_at&app_key=12xxxx&sign_method=sha256&access_token=50000200c10tlrxxx&timestamp=1697648276136';

const appSecret = 'AGk5JYxxxxx';

const signature = lazadaOpenApi.signByUrl(url, appSecret);
console.info(signature);

Response Data

{
  signature: 'EC3C4FE433B16CCD1921D37319F4397A308E0731DA0019773B058DBDE3CFA5E2',
  timestamp: 1697648276136
}

Back

Generate Signature

const lazadaOpenApi = require('lazada-open-api-package')

// The package helps remove the "sign", and the "time" has been decoded.
const params = {
    app_key: '12xxxxx',
    code: '0_122xxxxx',
    timestamp: '1697642709712',
    sign_method: 'sha256'
}
const path = '/auth/token/create';
const appSecret = 'AGk5JYxxxxx';
const signature = lazadaOpenApi.signature(params, path, appSecret);
console.info(signature);

Response Data

{
  signature: 'EC3C4FE433B16CCD1921D37319F4397A308E0731DA0019773B058DBDE3CFA5E2',
  timestamp: 1697648276136
}

Back

Generate Timestamp

const lazadaOpenApi = require('lazada-open-api-package')

const timestamp = lazadaOpenApi.timestamp();
console.info(timestamp);

Response Data

1697650466818

Back

Generate Token using Auth Code

const lazadaOpenApi = require('lazada-open-api-package');
const appKey = 'your_app_key';
const authCode = 'your_auth_code';
const appSecret = 'your_app_secret';

const accessToken = await lazadaOpenApi.authCodeToken(appKey, authCode, appSecret);
console.info(accessToken);

Response Data

{
  access_token: '500003xxx',
  country: 'vn',
  refresh_token: '50001xxx',
  country_user_info_list: [
    {
      country: 'vn',
      user_id: '200xxx',
      seller_id: '200xxx',
      short_code: 'xxx'
    }
  ],
  account_platform: 'seller_center',
  refresh_expires_in: 2589988,
  expires_in: 604800,
  account: 'xxx',
  code: '0',
  request_id: 'xxx'
}

Back

Generate Token using Refresh Token

const lazadaOpenApi = require('lazada-open-api-package');
const appKey = 'your_app_key';
const refreshToken = 'your_refresh_token';
const appSecret = 'your_app_secret';

const accessToken = await lazadaOpenApi.authCodeToken(appKey, refreshToken, appSecret);
console.info(accessToken);

Response Data

{
  access_token: '500003xxx',
  country: 'vn',
  refresh_token: '50001xxx',
  country_user_info_list: [
    {
      country: 'vn',
      user_id: '200xxx',
      seller_id: '200xxx',
      short_code: 'xxx'
    }
  ],
  account_platform: 'seller_center',
  refresh_expires_in: 2589988,
  expires_in: 604800,
  account: 'xxx',
  code: '0',
  request_id: 'xxx'
}

Back

Follow me on: Linkedin | Youtube | Facebook