Skip to content

sociuvn/order-management

Repository files navigation

SOCIU

Order Management

A CLI tool for get & sync Kiotviet, GHTK, GHN, VNPost data
Report bug · Request feature

CI

Table of contents

Bugs and feature requests

Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Some commands

Dev

Setting:

  • ENV:
# Setting ENV (key & value) to .env
npm run cli -- setting env -k KEY_ABC -v value_xyz

GHTK:

  • Token:
# Save token into .env
npm run cli -- ghtk token -s eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6xxxxxxxxxxxxxxxxxxxxxxxx
  • Orders:
# Get order by code
npm run cli -- ghtk get -c 123456789

GHN:

  • Token:
# Save token into .env
npm run cli -- ghn token -s xxxxxxxxxxxxxxxxxxxxxxxx
  • Orders:
# Get order by code
npm run cli -- ghn get -c EE123456789VN

# Get orders by date
npm run cli -- ghn get -d 2023-02-20

# Get orders from the date to current date
npm run cli -- ghn get -f 2023-02-20

# Get orders from the date to other date
npm run cli -- ghn get -f 2023-02-20 -t 2023-02-23

# Get orders from current date to the date
npm run cli -- ghn get -t 2023-02-26

VNPost:

  • Token:
# Save token into .env
npm run cli -- vnpost token -s eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6xxxxxxxxxxxxxxxxxxxxxxxx
  • Orders:
# Get order by code
npm run cli -- vnpost get -c EE123456789VN

# Get orders by date
npm run cli -- vnpost get -d 2023-02-20

# Get orders from the date to current date
npm run cli -- vnpost get -f 2023-02-20

# Get orders from the date to other date
npm run cli -- vnpost get -f 2023-02-20 -t 2023-02-23

# Get orders from current date to the date
npm run cli -- vnpost get -t 2023-02-26

ViettelPost:

  • Token:
# Save token into .env
npm run cli -- viettelpost token -s eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6xxxxxxxxxxxxxxxxxxxxxxxx
  • Orders:
# Get order by code
npm run cli -- viettelpost get -c 1755979111111

# Get orders by date
npm run cli -- viettelpost get -d 2023-02-20

# Get orders from the date to current date
npm run cli -- viettelpost get -f 2023-02-20

# Get orders from the date to other date
npm run cli -- viettelpost get -f 2023-02-20 -t 2023-02-23

# Get orders from current date to the date
npm run cli -- viettelpost get -t 2023-02-26

Kiotviet

  • Token:
# Get token
npm run cli -- kiotviet token -g

# Save token into .env
npm run cli -- kiotviet token -s

# Show and save token into .env
npm run cli -- kiotviet token -gs
  • Branches:
# Show list branches
npm run cli -- kiotviet branches list
  • Customers:
# Create customers from VNPost, GHTK orders by date
npm run cli -- kiotviet customers create -d 2023-02-20

# Create customers from VNPost, GHTK orders from the date to current date
npm run cli -- kiotviet customers create -f 2023-02-20

# Create customers from VNPost, GHTK orders from the date to other date
npm run cli -- kiotviet customers create -f 2023-02-20 -t 2023-02-23

# Create customers from VNPost, GHTK orders from current date to the date
npm run cli -- kiotviet customers create -t 2023-02-26
  • Invoices:
# Get invoice by code
npm run cli -- kiotviet invoices get -c HD123456

# Sync invoice by code
npm run cli -- kiotviet invoices sync -c HD123456

# Sync invoices by date
npm run cli -- kiotviet invoices sync -d 2023-02-20

# Sync invoices from the date to current date
npm run cli -- kiotviet invoices sync -f 2023-02-20

# Sync invoices from the date to other date
npm run cli -- kiotviet invoices sync -f 2023-02-20 -t 2023-02-23

# Sync invoices from current date to the date
npm run cli -- kiotviet invoices sync -t 2023-02-26

Creators

Thanks

Copyright and license

Copyright 2022. Code released under the MIT License.

Enjoy 🤘