Socket
Book a DemoInstallSign in
Socket

pancake-client-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pancake-client-sdk

Official TypeScript SDK for Pancake POS API

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Pancake POS SDK

SDK TypeScript chính thức cho Pancake POS API. Thư viện này cung cấp cách đơn giản và type-safe để tương tác với nền tảng Pancake POS.

Cài Đặt

npm install pancake-client-sdk
# hoặc
yarn add pancake-client-sdk

Bắt Đầu Nhanh

import { PancakeClient } from 'pancake-client-sdk';

// Khởi tạo client với shop ID
const client = new PancakeClient('your-api-key', 'your-shop-id');

// Ví dụ: Lấy danh sách đơn hàng
const getOrders = async () => {
  const orders = await client.orders.list({
    page_size: 10,
    page_number: 1
  });
  console.log(orders);
};

// Ví dụ: Tạo sản phẩm mới
const createProduct = async () => {
  const product = await client.products.create({
    name: 'Test Product',
    price: 100,
    description: 'A test product'
  });
  console.log(product);
};

Tính Năng Chính

  • Hỗ trợ TypeScript đầy đủ với định nghĩa types
  • Bao phủ toàn bộ các endpoint của Pancake POS API
  • Tích hợp typing cho request/response
  • Xử lý lỗi tự động
  • Giao diện API trực quan và dễ sử dụng

Các Resource Có Sẵn

  • Khách hàng & CRM
  • Đơn hàng & Trả hàng
  • Sản phẩm & Kho hàng
  • Kho vận & Logistics
  • Khuyến mãi & Tích điểm
  • Thanh toán & Tài chính
  • Nhân viên & Phân quyền
  • Media & Files
  • Báo cáo & Phân tích
  • Cài đặt & Tùy chỉnh

Xử Lý Lỗi

SDK ném ra các lỗi có type định nghĩa sẵn:

try {
  const order = await client.orders.getById('order-id');
} catch (error) {
  if (error.status === 404) {
    console.log('Không tìm thấy đơn hàng');
  } else {
    console.error('Đã xảy ra lỗi:', error);
  }
}

Giấy Phép

MIT License - Xem LICENSE để biết thêm chi tiết.

Keywords

pancake

FAQs

Package last updated on 29 Apr 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.