Prefer plain HTTP? Every guide in these docs shows the raw requests too.
Node.js / TypeScript
What it does for you
- Authentication. It exchanges your key and secret for a token on the first call, reuses
it, and renews it before it expires. You never call
/authyourself. - Scopes. Pass
scopeswith what this service needs. A missing one throwsKoriPermissionError, anderror.requiredScopestells you which scope to add. - Pagination.
await kori.payouts.list()returns the first page.for await (const p of kori.payouts.list())walks every page. - Errors. Each failure throws a typed error (
KoriValidationError,KoriConflictError,KoriRateLimitError, and so on) that carries therequestId. Quote that ID to support. - Safe retries. Reads are retried after network errors and 5xx.
payments.collect,payments.depositandpayouts.createare never repeated after a timeout, because the customer may already have been prompted. Look the payment up by yourreferenceinstead. - Webhooks.
kori.webhooks.verify(rawBody, signature, secret)checks the signature and returns the typed event. See Webhooks.