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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@redonvn/tracuu-vin-hoadon-sdk

v0.1.1

Published

TracuuVinHoadon invoice lookup SDK

Downloads

109

Readme

@redonvn/tracuu-vin-hoadon-sdk

TypeScript SDK for TracuuVinHoadon invoice lookup.

Install

npm install @redonvn/tracuu-vin-hoadon-sdk

Usage

Using VinHoadonClient and VinHoadonService

import { VinHoadonClient, VinHoadonService } from "@redonvn/tracuu-vin-hoadon-sdk";

const client = new VinHoadonClient();
const service = new VinHoadonService(client);

// Step 1: Get captcha
const captchaResponse = await service.refreshCaptcha();
console.log("Captcha key:", captchaResponse.result.key);
console.log("Captcha image:", captchaResponse.result.image);

// Step 2: Upload captcha image to Cloudinary (optional)
const imageUpload = await service.uploadImage(captchaResponse.result.image);
console.log("Image URL:", imageUpload.secure_url);

// Step 3: Look up invoice with captcha
const traCuuResult = await service.traCuu({
  key: captchaResponse.result.key,
  captcha: "6241", // User-entered captcha
  maSoBiMat: "2AP7TGLT96NC"
});
console.log("Invoice:", traCuuResult.result.hoaDon);

// Step 4: Upload XML/PDF files to Cloudinary (optional)
if (traCuuResult.result.fileData) {
  const rawUpload = await service.uploadRaw(traCuuResult.result.fileData.fileData);
  console.log("File URL:", rawUpload.secure_url);
}

One-off helpers

import { refreshCaptcha, traCuu, uploadImage, uploadRaw } from "@redonvn/tracuu-vin-hoadon-sdk";

// Refresh captcha
const captcha = await refreshCaptcha();
console.log(captcha.result.key);

// Look up invoice
const result = await traCuu({
  key: "2c19874e-6608-46aa-aa5f-af7e8606f536",
  captcha: "6241",
  maSoBiMat: "2AP7TGLT96NC"
});
console.log(result.result.hoaDon?.dnBan_Ten);

// Upload image to Cloudinary
const imageResponse = await uploadImage("data:image/png;base64,...");
console.log(imageResponse.secure_url);

// Upload raw file to Cloudinary
const rawResponse = await uploadRaw("data:application/xml;base64,...");
console.log(rawResponse.secure_url);

Configuration

const client = new VinHoadonClient({
  baseUrl: "https://tracuu.vin-hoadon.com", // Default
  cloudinaryCloudName: "dqqt6hlhk", // Default
  timeoutMs: 30000
});

API Endpoints

1. RefreshCaptcha

  • Method: POST
  • URL: https://tracuu.vin-hoadon.com/api/services/hddt/TraCuuHoaDon/RefreshCaptcha
  • Description: Get a new captcha image and key for invoice lookup

2. TraCuu

  • Method: POST
  • URL: https://tracuu.vin-hoadon.com/api/services/hddt/TraCuuHoaDon/TraCuu
  • Description: Look up invoice with captcha verification
  • Parameters:
    • key: Captcha key from RefreshCaptcha
    • captcha: User-entered captcha code
    • maSoBiMat: Secret code from invoice

3. Upload Image to Cloudinary

  • Method: POST
  • URL: https://api.cloudinary.com/v1_1/dqqt6hlhk/image/upload
  • Description: Upload image to Cloudinary using unsigned upload preset

4. Upload Raw to Cloudinary

  • Method: POST
  • URL: https://api.cloudinary.com/v1_1/dqqt6hlhk/raw/upload
  • Description: Upload raw files (XML, PDF, etc.) to Cloudinary using unsigned upload preset