K-OTP

잔액 조회

GET /v1/balance

GET https://api.k-otp.dev/v1/balance

개요

Returns the current credit wallet balance for the authenticated app. balance is a credit quantity (not money) and currency is CREDIT. Reading the balance never affects OTP issue status.

Requires an sk_ secret key; pk_ public keys are rejected with 403.

인증

허용 키필요 scope대체 허용 scope
sk_otp:balance*

응답 (200)

Current wallet balance.

필드타입필수설명
appIdstring예
balancenumber예Current balance as a credit quantity (not money).
currencystring예Unit of balance; currently always CREDIT.
updatedAtstring예When the wallet last changed (RFC 3339).

오류 응답

모든 오류는 { defined, code, status, message, data? } 형태입니다. 자세한 내용은 오류를 참고하세요.

상태code설명
400BAD_REQUESTthe request failed input validation. message describes the first failing constraint.
401UNAUTHORIZEDthe Authorization: Bearer credential is missing, malformed, inactive, or rejected by introspection.
403FORBIDDENthe credential lacks otp:balance (or an accepted alias), or a pk_ public key was used. Public keys are limited to issue/verify.
409CONFLICTthe request conflicts with the current state of the resource.
500INTERNAL_SERVER_ERRORunexpected server failure. Undefined errors (defined: false) use the same envelope.
503SERVICE_UNAVAILABLEcredential introspection or a downstream dependency is temporarily unavailable. Retry with backoff.

요청 예시

curl "https://api.k-otp.dev/v1/balance" \
  -H "Authorization: Bearer $KOTP_SECRET_KEY"

이 페이지의 내용