Get credit usage
GEThttps://api.checkslip.com/api/usage
API key
Returns how many lookups were made, how many took a credit and how many did not, with a count per reason such as free_not_found or free_too_old, per day or per month in Thailand time (interval=DAY or MONTH). A day or month with no lookups is returned as zero, not skipped. One request covers at most 92 days or 24 months. A lookup counts on the day its credit was settled (settled_at), not the day it was sent. The two are usually seconds apart, so a lookup near midnight can land on the next day. The counts trail real time by about 1 minute (see as_of); for each lookup as it happens, use the lookup history (it needs slip:read). Reading usage uses no credit. Needs an API key with usage:read.
Parameters
| Field | In | Type | Required |
|---|---|---|---|
X-Request-Id | header | string | no |
interval | query | DAY | MONTH | no |
from | query | string (date) | yes |
to | query | string (date) | yes |
Responses
200 application/json
| Field | Type | Required |
|---|---|---|
interval | DAY | MONTH | yes |
as_of | string (date-time) | yes |
from | string (date) | yes |
to | string (date) | yes |
timezone | string = Asia/Bangkok | yes |
buckets | object[] | yes |
totals | UsageCounts | yes |
totals.checks | integer | yes |
totals.charged | integer | yes |
totals.free_not_found | integer | yes |
totals.free_duplicate | integer | yes |
totals.free_unavailable | integer | yes |
totals.free_invalid_qr | integer | yes |
totals.free_invalid_file | integer | yes |
totals.free_qr_tampered | integer | yes |
totals.free_too_old | integer | yes |
totals.free_system_error | integer | yes |
totals.free_other | integer | yes |
Possible errors
400401default
An error as Problem Details. All codes are listed at Error codes