
Lazada API Client
API Client • v1.0.6npm i lazada-api-clientlazada-api-client is a TypeScript library for Lazada Open API, and works against every Lazada region (sg, my, th, vn, id, ph, cb). It covers seller OAuth (generateAuthLink, fetchTokenWithAuthCode, refreshToken), orders (getOrdersBeforeSomeDay, getOrderDetail), and products (getProducts, getProductItem, updateSellableQuantity, updateStatusProduct, updatePrice, getCategoryTree, getBrandByPages, createProduct). Every request is signed for you following the Lazada API signature scheme.
Key Features
- ◆OAuth: generateAuthLink, fetchTokenWithAuthCode, refreshToken
- ◆Orders: getOrdersBeforeSomeDay, getOrderDetail
- ◆Products: getProducts, getProductItem, updateSellableQuantity, updateStatusProduct, updatePrice
- ◆Categories & brands: getCategoryTree, getBrandByPages, createProduct
- ◆Regions: sg, my, th, vn, id, ph, cb
- ◆SHA256 request signing handled for you, per the Lazada spec
Code Examples
Setup & configuration
import { LazadaModule } from "lazada-api-client";
const lazada = new LazadaModule({
appKey: process.env.LAZADA_APP_KEY!,
appSecret: process.env.LAZADA_APP_SECRET!,
appAccessToken: process.env.LAZADA_ACCESS_TOKEN!,
refreshToken: process.env.LAZADA_REFRESH_TOKEN!,
countryCode: "sg", // sg, my, th, vn, id, ph, cb
});Managing products
// List products
const products = await lazada.getProducts();
console.log(products);
// Update sellable quantity
await lazada.updateSellableQuantity(123456, {
sku_id: "SKU001",
seller_sku: "PRODUCT-SKU",
sellable_quantity: 100,
});
// Update product status
await lazada.updateStatusProduct(123456, {
status: "active", // or "inactive"
});Resources
Related Article
Building an e-commerce SDK monorepo with npm workspaces
Managing a multi-package project, keeping versions in sync, and streamlining releases with Changesets.
Lazada API Client — API Client • v1.0.6Trở về Trang chủ