
Lazada API Client
API Clientnpm i lazada-api-clientlazada-api-client is a TypeScript library for Lazada Open API, covering the 33 domains of the Lazada OpenAPI specification (363 endpoints): orders, products, logistics, fulfillment, finance, returns and refunds, vouchers, sponsored solutions and more. Each request goes to the regional host for the configured country (sg, vn, ph, my, th, id) and is signed with HMAC-SHA256. POST payloads travel in a form-encoded body rather than the URL, so large requests no longer hit URL length limits. The domains live under typed namespaces (lazada.finance, lazada.order, …); failures throw a LazadaApiError, and every call has a 30-second timeout.
Key Features
- ◆363 endpoints across 33 domains: orders, products, logistics, fulfillment, finance, returns, vouchers, sponsored solutions, IM and more
- ◆Regional routing: requests go to the host for countryCode (sg, vn, ph, my, th, id); token calls use the auth host
- ◆Namespaced domains (lazada.finance.*, lazada.order.*, lazada.fbl.*) sit next to the original flat methods
- ◆Errors: any non-zero response code throws a LazadaApiError with code, type, request ID and HTTP status
- ◆30s timeout on every call; POST payloads sent as a form-encoded body, not in the URL
- ◆Orders: getOrders (one page) and getAllOrders (auto-pagination), plus pack, ready-to-ship and AWB printing
- ◆HMAC-SHA256 request signing handled for you; no any in the public API; 18 unit tests
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, vn, ph, my, th, id
});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"
});Orders, namespaces and typed errors
import { LazadaApiError } from "lazada-api-client";
try {
// Every order updated in the last 24 hours, all pages fetched for you
const since = new Date(Date.now() - 24 * 3600 * 1000).toISOString();
const orders = await lazada.getAllOrders({ update_after: since });
console.log(orders.length);
// Newer domains live under their own namespace
const payouts = await lazada.finance.getPayoutStatus({ created_after: since });
console.log(payouts);
} catch (err) {
if (err instanceof LazadaApiError) {
console.error(err.code, err.type, err.requestId);
}
throw err;
}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 ClientBack to Home