Versions in this module Expand all Collapse all v0 v0.4.0 Nov 10, 2026 Changes in this version + type CustomerFreeReason string + const CustomerFreeReasonDuplicate + const CustomerFreeReasonInvalidFile + const CustomerFreeReasonInvalidQR + const CustomerFreeReasonNotFound + const CustomerFreeReasonOther + const CustomerFreeReasonQRTampered + const CustomerFreeReasonSystemError + const CustomerFreeReasonTooOld + const CustomerFreeReasonUnavailable v0.3.1 Nov 10, 2026 v0.3.0 Nov 9, 2026 v0.2.0 Nov 9, 2026 Changes in this version type FreeReason + const FreeReasonOther type UsageCounts + FreeOther int64 v0.1.1 Nov 9, 2026 v0.1.0 Nov 9, 2026 Changes in this version + const DefaultBaseURL + const DefaultWebhookTolerance + const MaxImageSize + const MaxWebhookBody + const Version + var ErrWebhookMissingHeaders = errors.New("checkslip: webhook headers missing") + var ErrWebhookSignature = errors.New("checkslip: webhook signature does not match") + var ErrWebhookTimestamp = errors.New("checkslip: webhook timestamp outside tolerance") + func HasCode(err error, code ErrorCode) bool + func IsForbidden(err error) bool + func IsNoCredit(err error) bool + func IsNotFound(err error) bool + func IsRateLimited(err error) bool + func IsServerError(err error) bool + func IsUnauthenticated(err error) bool + func IsValidation(err error) bool + func NewIdempotencyKey() string + func VerifyWebhook(secret string, header http.Header, body []byte) error + type APIRequestRecord struct + APIKeyID *string + Channel *Channel + ClientIPHMAC string + ClientIPPrefix string + Fingerprint *Fingerprint + HTTPStatus int + LatencyMs int + Method string + OutcomeCode string + ReceivedAt time.Time + RequestID string + Route string + UserAgent string + UserID *string + type ActorType string + const ActorAPIKey + const ActorAssistant + const ActorStaff + const ActorSystem + const ActorUser + type AttemptOutcome string + const AttemptConnectError + const AttemptDestinationBlocked + const AttemptHTTPError + const AttemptRedirectNotFollowed + const AttemptSuccess + const AttemptTLSError + const AttemptTimeout + type AttemptTrigger string + const TriggerRecover + const TriggerRedeliver + const TriggerSchedule + type AuditActor struct + ID *string + OnBehalfOfUser *string + Type ActorType + type AuditCategory string + const AuditAccess + const AuditDataChange + const AuditMoney + const AuditSecurity + const AuditSensitiveRead + type AuditEventRecord struct + Action string + Actor AuditActor + After map[string]any + Before map[string]any + Category AuditCategory + Channel Channel + EventID string + OccurredAt time.Time + Outcome AuditOutcome + Reason *string + RequestID *string + Target AuditTarget + UndoOfEventID *string + type AuditEventsService struct + func (s *AuditEventsService) Get(ctx context.Context, eventID string, opts ...RequestOption) (*AuditEventRecord, error) + func (s *AuditEventsService) List(ctx context.Context, params *ListAuditEventsParams, opts ...RequestOption) (*Page[AuditEventRecord], error) + func (s *AuditEventsService) ListAll(ctx context.Context, params *ListAuditEventsParams, opts ...RequestOption) *Iter[AuditEventRecord] + type AuditExportsService struct + func (s *AuditExportsService) Create(ctx context.Context, params *CreateEvidenceExportParams, opts ...RequestOption) (*EvidenceExport, error) + func (s *AuditExportsService) Download(ctx context.Context, exportID string, opts ...RequestOption) (*EvidenceFile, error) + func (s *AuditExportsService) Get(ctx context.Context, exportID string, opts ...RequestOption) (*EvidenceExport, error) + func (s *AuditExportsService) List(ctx context.Context, params *ListOptions, opts ...RequestOption) (*Page[EvidenceExport], error) + func (s *AuditExportsService) ListAll(ctx context.Context, params *ListOptions, opts ...RequestOption) *Iter[EvidenceExport] + type AuditOutcome string + const AuditDenied + const AuditFailure + const AuditSuccess + type AuditRequestsService struct + func (s *AuditRequestsService) Get(ctx context.Context, requestID string, opts ...RequestOption) (*APIRequestRecord, error) + func (s *AuditRequestsService) List(ctx context.Context, params *ListRequestsParams, opts ...RequestOption) (*Page[APIRequestRecord], error) + func (s *AuditRequestsService) ListAll(ctx context.Context, params *ListRequestsParams, opts ...RequestOption) *Iter[APIRequestRecord] + type AuditService struct + Events *AuditEventsService + Exports *AuditExportsService + Requests *AuditRequestsService + type AuditTarget struct + ID string + Type string + type Balance struct + AccountID string + Basis ThresholdBasis + Credits int64 + ExpiresAt *time.Time + LastEntryID *string + Low bool + Threshold int64 + UpdatedAt time.Time + type Bank struct + BOTCode string + Code string + NameEN *string + NameTH *string + type BanksService struct + func (s *BanksService) List(ctx context.Context, opts ...RequestOption) ([]SupportedBank, error) + type BillingBalanceService struct + func (s *BillingBalanceService) Get(ctx context.Context, opts ...RequestOption) (*Balance, error) + type BillingInfo struct + Address string + Branch string + BuyerType BuyerType + Email string + Name string + TaxID string + type BillingInfoService struct + func (s *BillingInfoService) Get(ctx context.Context, opts ...RequestOption) (*BillingInfo, error) + func (s *BillingInfoService) Update(ctx context.Context, info *BillingInfo, opts ...RequestOption) (*BillingInfo, error) + type BillingLedgerService struct + func (s *BillingLedgerService) List(ctx context.Context, params *LedgerParams, opts ...RequestOption) (*Page[CreditEntry], error) + func (s *BillingLedgerService) ListAll(ctx context.Context, params *LedgerParams, opts ...RequestOption) *Iter[CreditEntry] + type BillingOrdersService struct + func (s *BillingOrdersService) Get(ctx context.Context, orderID string, opts ...RequestOption) (*Order, error) + func (s *BillingOrdersService) List(ctx context.Context, params *OrdersParams, opts ...RequestOption) (*Page[Order], error) + func (s *BillingOrdersService) ListAll(ctx context.Context, params *OrdersParams, opts ...RequestOption) *Iter[Order] + func (s *BillingOrdersService) Sync(ctx context.Context, orderID string, opts ...RequestOption) (*Order, error) + type BillingPackagesService struct + func (s *BillingPackagesService) List(ctx context.Context, opts ...RequestOption) (*PackageList, error) + type BillingReceiptsService struct + func (s *BillingReceiptsService) Get(ctx context.Context, receiptID string, opts ...RequestOption) (*Receipt, error) + func (s *BillingReceiptsService) List(ctx context.Context, params *ListOptions, opts ...RequestOption) (*Page[Receipt], error) + func (s *BillingReceiptsService) ListAll(ctx context.Context, params *ListOptions, opts ...RequestOption) *Iter[Receipt] + type BillingService struct + Balance *BillingBalanceService + Info *BillingInfoService + Ledger *BillingLedgerService + Orders *BillingOrdersService + Packages *BillingPackagesService + Receipts *BillingReceiptsService + type BuyerType string + const BuyerCompany + const BuyerPerson + type Channel string + const ChannelAPI + const ChannelAssistant + const ChannelDashboard + const ChannelStaff + const ChannelSystem + type ChargedFilter string + const ChargedNo + const ChargedUnsettled + const ChargedYes + type Client struct + Audit *AuditService + Banks *BanksService + Billing *BillingService + Slips *SlipsService + Usage *UsageService + Webhooks *WebhooksService + func NewClient(apiKey string, opts ...Option) *Client + type CountBucket string + const BucketDay + const BucketFifteenMinutes + const BucketFiveMinutes + const BucketHour + const BucketMinute + const BucketSixHours + const BucketThreeHours + const BucketTwelveHours + type CountSeries struct + Counts map[Outcome]int64 + Start time.Time + type CreateEndpointParams struct + Description string + EventTypes []EventType + URL string + type CreateEvidenceExportParams struct + FromDay Date + Streams []Stream + ToDay Date + type CreditEntry struct + BalanceAfter int64 + CreatedAt time.Time + Delta int64 + ExpiresAtAfter *time.Time + FreeReason FreeReason + ID string + Reason CreditReason + RefID string + RefType string + type CreditReason string + const CreditAccountDeleted + const CreditDevGrant + const CreditExpire + const CreditPurchase + const CreditSlipCharge + const CreditSlipFree + const CreditStaffAdjust + const CreditTesterGrant + type Date struct + Day int + Month time.Month + Year int + func DateOf(t time.Time) Date + func ParseDate(s string) (Date, error) + func (d *Date) UnmarshalText(b []byte) error + func (d Date) IsZero() bool + func (d Date) MarshalText() ([]byte, error) + func (d Date) String() string + type Delivery struct + AttemptCount int + CreatedAt time.Time + EndpointID string + EventType EventType + ID string + LastAttemptAt *time.Time + LastHTTPStatus *int + MessageID string + NextAttemptAt *time.Time + Status DeliveryStatus + type DeliveryAttempt struct + AttemptNo int + AttemptedAt time.Time + DurationMS int64 + HTTPStatus *int + Outcome AttemptOutcome + ResponseExcerpt *string + Trigger AttemptTrigger + type DeliveryDetail struct + Attempts []DeliveryAttempt + Payload json.RawMessage + PayloadExpiresAt time.Time + type DeliveryStatus string + const DeliveryCancelled + const DeliveryFailed + const DeliveryPending + const DeliveryRetrying + const DeliverySucceeded + type DisabledReason string + const DisabledFailing + const DisabledGone + const DisabledManual + type DuplicateOf struct + CheckedAt time.Time + RequestID string + type Endpoint struct + CreatedAt time.Time + Description *string + DisabledReason DisabledReason + Enabled bool + EventTypes []EventType + ID string + PreviousSecretExpiresAt *time.Time + SecretHint string + URL string + UpdatedAt time.Time + type EndpointWithSecret struct + Secret string + type Error struct + Body []byte + Code ErrorCode + Detail string + Fields []FieldError + IdempotencyKey string + Instance string + RequestID string + RetryAfter time.Duration + StatusCode int + Title string + Type string + func AsError(err error) *Error + func (e *Error) Error() string + type ErrorCode string + const CodeCreditExpired + const CodeCreditUnavailable + const CodeDNSUnresolvable + const CodeDeliveryNotFound + const CodeDestinationBlocked + const CodeEndpointDeleted + const CodeEndpointDisabled + const CodeEndpointLimitReached + const CodeEndpointNotFound + const CodeForbidden + const CodeIdempotencyInFlight + const CodeIdempotencyKeyInvalid + const CodeIdempotencyKeyRequired + const CodeIdempotencyKeyReused + const CodeInternal + const CodeInvalidCursor + const CodeInvalidFile + const CodeInvalidQR + const CodeMultipleSlipQR + const CodeNoCredit + const CodeOrderNotFound + const CodePayloadExpired + const CodePayloadIntegrityMismatch + const CodePayloadTooLarge + const CodePaymentsUnavailable + const CodeQRTampered + const CodeRateLimited + const CodeReceiptNotFound + const CodeRecoverWindowInvalid + const CodeRotationInProgress + const CodeTooOld + const CodeURLHasUserinfo + const CodeURLNotHTTPS + const CodeUnauthenticated + const CodeUnavailable + const CodeUnknownEventType + const CodeUnsupportedMediaType + const CodeValidationFailed + type EventType string + const EventSlipChecked + const EventWebhookTest + type EventTypeInfo struct + Description string + Subscribable bool + Type EventType + type EvidenceExport struct + CreatedAt time.Time + CreatedBy *ExportCreator + ExpiresAt *time.Time + ExportID string + FromDay Date + Manifest *ExportManifest + ReadyAt *time.Time + State ExportState + Streams []Stream + ToDay Date + type EvidenceFile struct + ReprDigest string + Size int64 + type ExportColumn string + const ColumnAPIKeyID + const ColumnChannel + const ColumnChargeConfirmed + const ColumnCharged + const ColumnCheckedAt + const ColumnClientReference + const ColumnDuplicateOfRequestID + const ColumnFreeReason + const ColumnOutcome + const ColumnRequestID + const ColumnSlipAmountCurrency + const ColumnSlipAmountSatang + const ColumnSlipReceiverAccount + const ColumnSlipReceiverBankBOTCode + const ColumnSlipReceiverBankCode + const ColumnSlipReceiverNameEN + const ColumnSlipReceiverNameTH + const ColumnSlipSenderAccount + const ColumnSlipSenderBankBOTCode + const ColumnSlipSenderBankCode + const ColumnSlipSenderNameEN + const ColumnSlipSenderNameTH + const ColumnSlipTransRef + const ColumnSlipTransferredAt + const ColumnStatus + type ExportCreator struct + ID *string + Type ActorType + type ExportManifest struct + Format string + RecordCount int64 + SHA256 string + SizeBytes int64 + type ExportMode string + const ExportDirect + const ExportJob + type ExportPart struct + Part int + Rows *int64 + URL string + URLExpiresAt time.Time + type ExportState string + const ExportExpired + const ExportFailed + const ExportQueued + const ExportReady + const ExportRunning + type FieldError struct + Code string + Detail string + Pointer string + type Fingerprint struct + QRSHA256 string + TransRef string + type FreeReason string + const FreeReasonDuplicate + const FreeReasonHoldExpired + const FreeReasonInvalidFile + const FreeReasonInvalidQR + const FreeReasonNoCredit + const FreeReasonNotFound + const FreeReasonPending + const FreeReasonQRTampered + const FreeReasonSystemError + const FreeReasonTooOld + const FreeReasonUnavailable + type Iter struct + func (it *Iter[T]) All() iter.Seq2[T, error] + func (it *Iter[T]) Current() T + func (it *Iter[T]) Cursor() string + func (it *Iter[T]) Err() error + func (it *Iter[T]) Next() bool + type LedgerParams struct + From time.Time + Reason []CreditReason + To time.Time + type ListAuditEventsParams struct + Action string + ActorID string + ActorType ActorType + Channel Channel + From time.Time + TargetID string + TargetType string + To time.Time + type ListDeliveriesParams struct + EndpointID string + EventType EventType + Since time.Time + Status DeliveryStatus + Until time.Time + type ListOptions struct + Cursor string + Limit int + type ListRequestsParams struct + APIKeyID string + Channel Channel + From time.Time + HTTPStatus int + OutcomeCode string + QRSHA256 string + Route string + To time.Time + TransRef string + type ListSlipsParams struct + APIKey string + After string + Charged []ChargedFilter + FreeReason []FreeReason + From time.Time + Outcome []Outcome + OutcomeNot []Outcome + Q string + SenderBank string + To time.Time + TransRef string + type LookupParams struct + ClientReference string + ContentType string + Filename string + Image io.Reader + QR string + type Money struct + Currency string + Satang int64 + func (m Money) String() string + type Option func(*Client) + func WithBaseURL(rawURL string) Option + func WithHTTPClient(hc *http.Client) Option + func WithMaxRetries(n int) Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type Order struct + Amount Money + CancelledAt *time.Time + Confirming bool + CreatedAt time.Time + Credits int64 + ID string + PackageCode string + PackageNameTH string + PaidAt *time.Time + PaymentMethod PaymentMethod + ReceiptID *string + ReviewReason *string + Status OrderStatus + type OrderStatus string + const OrderCancelled + const OrderFlagged + const OrderPaid + const OrderPending + type OrdersParams struct + Status OrderStatus + type Outcome string + const OutcomeDuplicate + const OutcomeFound + const OutcomeInvalidFile + const OutcomeInvalidQR + const OutcomeNotFound + const OutcomePending + const OutcomeQRTampered + const OutcomeTooOld + const OutcomeUnavailable + type Package struct + Code string + Credits int64 + ForSale bool + NameEN string + NameTH string + Price Money + PricePerCredit Money + Sort int + ValidityDays int + type PackageList struct + CheckoutOpen bool + Items []Package + PricesIncludeVAT bool + type Page struct + Items []T + NextCursor string + func (p *Page[T]) HasMore() bool + func (p *Page[T]) UnmarshalJSON(b []byte) error + type Party struct + Account *string + Bank Bank + NameEN *string + NameTH *string + type PaymentMethod string + const PaymentCard + const PaymentPromptPay + type Receipt struct + Buyer BillingInfo + ID string + IssuedAt time.Time + Lines []ReceiptLine + OrderID string + PaymentMethod PaymentMethod + ReceiptNo string + Seller ReceiptSeller + SellerReady bool + Total Money + VAT *ReceiptVAT + type ReceiptLine struct + Amount Money + Description string + Quantity int + type ReceiptSeller struct + Address string + Branch string + Name string + TaxID string + type ReceiptVAT struct + Amount Money + Base Money + RateBP int + type Receiver struct + Account *string + Bank *Bank + Kind ReceiverKind + NameEN *string + NameTH *string + type ReceiverKind string + const ReceiverBankAccount + const ReceiverBillPayment + const ReceiverNotBankAccount + type RecoverParams struct + Since time.Time + Until time.Time + func (p RecoverParams) MarshalJSON() ([]byte, error) + type RecoverResult struct + EndpointID string + Since time.Time + Until time.Time + type RequestOption func(*requestConfig) + func WithHeader(key, value string) RequestOption + func WithIdempotencyKey(key string) RequestOption + type SecretRotation struct + PreviousSecretExpiresAt time.Time + Secret string + type Slip struct + Amount *Money + NamesErased bool + Receiver *Receiver + ReceiverBank *Bank + Sender *Party + SenderBank *Bank + TransRef string + TransferredAt time.Time + func (s *Slip) IsSummary() bool + type SlipCheck struct + CheckedAt time.Time + ClientReference *string + DuplicateOf *DuplicateOf + IdempotencyKey string + Outcome Outcome + RequestID string + RetryAfter time.Duration + Slip *Slip + type SlipCheckRecord struct + APIKeyID *string + Channel Channel + ChargeConfirmed *bool + Charged *bool + CheckedAt time.Time + ClientReference *string + DuplicateOf *DuplicateOf + FreeReason *FreeReason + Outcome Outcome + RequestID string + Slip *Slip + Status int + type SlipCheckedData struct + Channel Channel + CheckedAt time.Time + ClientReference *string + DuplicateOf *DuplicateOf + Outcome Outcome + RequestID string + ResolvedAfterPending bool + Slip *Slip + type SlipCounts struct + AsOf time.Time + Bucket CountBucket + FiltersApplied []string + FiltersIgnored []string + Series []CountSeries + type SlipCountsParams struct + Bucket CountBucket + From time.Time + Outcome []Outcome + OutcomeNot []Outcome + To time.Time + type SlipExport struct + ContinueCursor *string + CreatedAt time.Time + ExpiresAt *time.Time + ExportID string + Mode ExportMode + Parts []ExportPart + Request SlipExportParams + Rows *int64 + State ExportState + Truncated bool + type SlipExportParams struct + APIKey string + Charged []ChargedFilter + Columns []ExportColumn + Cursor string + FreeReason []FreeReason + From *time.Time + Outcome []Outcome + OutcomeNot []Outcome + Q string + SenderBank string + To *time.Time + TransRef string + type SlipExportsService struct + func (s *SlipExportsService) Create(ctx context.Context, params *SlipExportParams, opts ...RequestOption) (*SlipExport, error) + func (s *SlipExportsService) DownloadPart(ctx context.Context, part ExportPart, opts ...RequestOption) (io.ReadCloser, error) + func (s *SlipExportsService) Get(ctx context.Context, exportID string, opts ...RequestOption) (*SlipExport, error) + type SlipsService struct + Exports *SlipExportsService + func (s *SlipsService) Counts(ctx context.Context, params *SlipCountsParams, opts ...RequestOption) (*SlipCounts, error) + func (s *SlipsService) Get(ctx context.Context, requestID string, opts ...RequestOption) (*SlipCheckRecord, error) + func (s *SlipsService) List(ctx context.Context, params *ListSlipsParams, opts ...RequestOption) (*Page[SlipCheckRecord], error) + func (s *SlipsService) ListAll(ctx context.Context, params *ListSlipsParams, opts ...RequestOption) *Iter[SlipCheckRecord] + func (s *SlipsService) Lookup(ctx context.Context, params *LookupParams, opts ...RequestOption) (*SlipCheck, error) + type Stream string + const StreamAPIRequests + const StreamAuditEvents + type SupportedBank struct + BOTCode string + Code string + LandingPage bool + LookbackDays int + NameEN string + NameTH string + SupportedSince Date + type ThresholdBasis string + const ThresholdAvg7Days + const ThresholdFallback10Percent + const ThresholdNone + type UpdateEndpointParams struct + ClearDescription bool + Description *string + Enabled *bool + EventTypes []EventType + URL *string + func (p UpdateEndpointParams) MarshalJSON() ([]byte, error) + type Usage struct + AsOf time.Time + Buckets []UsageBucket + From Date + Interval UsageInterval + Timezone string + To Date + Totals UsageCounts + type UsageBucket struct + Start Date + type UsageCounts struct + Charged int64 + Checks int64 + FreeDuplicate int64 + FreeHoldExpired int64 + FreeInvalidFile int64 + FreeInvalidQR int64 + FreeNoCredit int64 + FreeNotFound int64 + FreeQRTampered int64 + FreeSystemError int64 + FreeTooOld int64 + FreeUnavailable int64 + type UsageInterval string + const UsageDay + const UsageMonth + type UsageParams struct + From Date + Interval UsageInterval + To Date + type UsageService struct + func (s *UsageService) Get(ctx context.Context, params *UsageParams, opts ...RequestOption) (*Usage, error) + type WebhookDeliveriesService struct + func (s *WebhookDeliveriesService) Get(ctx context.Context, deliveryID string, opts ...RequestOption) (*DeliveryDetail, error) + func (s *WebhookDeliveriesService) List(ctx context.Context, params *ListDeliveriesParams, opts ...RequestOption) (*Page[Delivery], error) + func (s *WebhookDeliveriesService) ListAll(ctx context.Context, params *ListDeliveriesParams, opts ...RequestOption) *Iter[Delivery] + func (s *WebhookDeliveriesService) Redeliver(ctx context.Context, deliveryID string, opts ...RequestOption) (*Delivery, error) + type WebhookEndpointsService struct + func (s *WebhookEndpointsService) Create(ctx context.Context, params *CreateEndpointParams, opts ...RequestOption) (*EndpointWithSecret, error) + func (s *WebhookEndpointsService) Delete(ctx context.Context, endpointID string, opts ...RequestOption) error + func (s *WebhookEndpointsService) Get(ctx context.Context, endpointID string, opts ...RequestOption) (*Endpoint, error) + func (s *WebhookEndpointsService) List(ctx context.Context, params *ListOptions, opts ...RequestOption) (*Page[Endpoint], error) + func (s *WebhookEndpointsService) ListAll(ctx context.Context, params *ListOptions, opts ...RequestOption) *Iter[Endpoint] + func (s *WebhookEndpointsService) Recover(ctx context.Context, endpointID string, params *RecoverParams, ...) (*RecoverResult, error) + func (s *WebhookEndpointsService) RotateSecret(ctx context.Context, endpointID string, opts ...RequestOption) (*SecretRotation, error) + func (s *WebhookEndpointsService) SendTest(ctx context.Context, endpointID string, opts ...RequestOption) (*Delivery, error) + func (s *WebhookEndpointsService) Update(ctx context.Context, endpointID string, params *UpdateEndpointParams, ...) (*Endpoint, error) + type WebhookEvent struct + Data json.RawMessage + ID string + Timestamp time.Time + Type EventType + func ParseWebhookEvent(body []byte) (*WebhookEvent, error) + func (e *WebhookEvent) SlipChecked() (*SlipCheckedData, error) + func (e *WebhookEvent) Test() (*WebhookTestData, error) + type WebhookEventTypesService struct + func (s *WebhookEventTypesService) List(ctx context.Context, opts ...RequestOption) ([]EventTypeInfo, error) + type WebhookTestData struct + EndpointID string + type WebhookVerifier struct + func NewWebhookVerifier(secrets ...string) (*WebhookVerifier, error) + func (v *WebhookVerifier) SetTolerance(d time.Duration) *WebhookVerifier + func (v *WebhookVerifier) Verify(header http.Header, body []byte) error + func (v *WebhookVerifier) VerifyRequest(r *http.Request) (*WebhookEvent, error) + type WebhooksService struct + Deliveries *WebhookDeliveriesService + Endpoints *WebhookEndpointsService + EventTypes *WebhookEventTypesService + func (s *WebhooksService) Verify(header http.Header, body []byte, secrets ...string) (*WebhookEvent, error)