View on GitHub

RevenueDepartmentService

ระบบจัดการ Service ของกรมสรรพากร โดยใช้ RESTful API .NET Core 2.2/3.1 ในการเชื่อมต่อกับ SOAP Web Service และแปลงข้อมูลให้อยู่ในรูปแบบของ JSON และใช้ Swagger

RESTful API กรมสรรพากร / The Revenue Department Service

ระบบจัดการ Service ของกรมสรรพากร โดยใช้ RESTful API ในการเชื่อมต่อกับ SOAP Web Service และแปลงข้อมูลให้อยู่ในรูปแบบของ JSON และใช้ Swagger Code ทั้งหมดนี้เป็นเพียง Code ตั้งต้น เพื่อนำไปต่อยอดต่อไป

Document ของกรมสรรพากร: http://www.rd.go.th/publish/42545.0.html API นี้จะประกอบไปด้วย Service ดังนี้ (รายละเอียดสามารถดูได้ตามลิงค์ที่แนบไว้)

  1. Common Service: คลิกเพื่อดู Document
  2. TIN Service: คลิกเพื่อดู Document
  3. VRT Service: คลิกเพื่อดู Document
  4. VAT Service: คลิกเพื่อดู Document
  5. GEM Service: คลิกเพื่อดู Document

Branch

Swagger Document

สามารถดูรายละเอียดต่างๆของ API โดย คลิกที่นี่

Software Requirement

  1. Visual Studio 2017 or latest
  2. .NET Core 2.2
  3. .NET Core Runtime 2.2
  4. Swashbuckle.AspNetCore v.4.0.1
  5. System.ServiceModel.Http v.4.4.0

วิธีการการ Add Trusted Root Certification Authorities

เบื้องต้นให้เราติดตั้ง Cer ทั้งสองตัวคือ adhq1.cer และ ADHQ5.cer ก่อน โดย Cer. จะอยู่ในโฟลเดอร์ Resources หรือ Download ที่ Client Certificate

ถ้าหากยังไม่สามารถเรียก API กรมสรรพากรได้ ให้ทำการ Add Cer. ที่ชื่อ adhq1.cer เข้าไปที่ Trusted Root Certification Authorities ก่อน จึงจะสามารถใช้งาน API ของทางกรมสรรพากรได้

ส่วนวิธี Add Trusted Root Certification Authorities สำหรับ Windows 10

  1. เปิด Run > certlm.msc หรือ กด Start แล้ว Search พิมพ์ว่า “Certificates” แล้วเลือก Manage User Certificates
  2. หาเมนูที่ชื่อ Trusted Root Certification Authorities > Certificates
  3. คลิกขวาที่ Certificates เลือก Import และเลือกที่อยู่ของ adhq1.cer ตัวนี้