ดูยอดการใช้เครดิต
GEThttps://api.checkslip.com/api/usage
ใช้ API key
แสดงจำนวนครั้งที่ตรวจ จำนวนครั้งที่หักเครดิต และจำนวนครั้งที่ไม่หัก แยกเป็นช่องตามเหตุผล เช่น free_not_found หรือ free_too_old เป็นรายวันหรือรายเดือนตามเวลาประเทศไทย (interval=DAY หรือ MONTH) วันหรือเดือนที่ไม่มีการตรวจจะแสดงเป็นศูนย์ ไม่ถูกข้าม รายวันดูได้ครั้งละไม่เกิน 92 วัน รายเดือนไม่เกิน 24 เดือน ยอดนับตามวันที่คิดเครดิตเสร็จ (settled_at) ไม่ใช่วันที่ส่งตรวจ ปกติห่างกันไม่กี่วินาที การตรวจใกล้เที่ยงคืนจึงอาจไปนับวันถัดไป ยอดช้ากว่าเวลาจริงประมาณ 1 นาที (ดูเวลาของยอดที่ as_of) ถ้าต้องการผลทีละรายการที่ตรงทันทีให้ดูประวัติการตรวจ (ต้องมีสิทธิ์ slip:read) เรียกดูยอดไม่หักเครดิต ใช้ API key ที่มีสิทธิ์ usage:read
Parameters
| ฟิลด์ | ส่งทาง | ชนิด | จำเป็น |
|---|---|---|---|
X-Request-Id | header | string | ไม่ |
interval | query | DAY | MONTH | ไม่ |
from | query | string (date) | ใช่ |
to | query | string (date) | ใช่ |
Responses
200 application/json
| ฟิลด์ | ชนิด | จำเป็น |
|---|---|---|
interval | DAY | MONTH | ใช่ |
as_of | string (date-time) | ใช่ |
from | string (date) | ใช่ |
to | string (date) | ใช่ |
timezone | string = Asia/Bangkok | ใช่ |
buckets | object[] | ใช่ |
totals | UsageCounts | ใช่ |
totals.checks | integer | ใช่ |
totals.charged | integer | ใช่ |
totals.free_not_found | integer | ใช่ |
totals.free_duplicate | integer | ใช่ |
totals.free_unavailable | integer | ใช่ |
totals.free_invalid_qr | integer | ใช่ |
totals.free_invalid_file | integer | ใช่ |
totals.free_qr_tampered | integer | ใช่ |
totals.free_too_old | integer | ใช่ |
totals.free_system_error | integer | ใช่ |
totals.free_other | integer | ใช่ |
Error ที่อาจได้
400401default
error ในรูป Problem Details ดูรหัสทั้งหมดที่ รหัสข้อผิดพลาด