Skip to content

TossApiFailure — @gj-kit/toss-payments

A public interface from @gj-kit/toss-payments. The signature below is taken directly from the 0.6.1 release declaration.

import { TossApiFailure } from '@gj-kit/toss-payments';
/**
* 에러 모델 — 최상위 판별자 `source`: 'library'(API 미도달 보장) / 'toss'(서버 응답) / 'network'(전송).
*
* retryable 판정은 **코드 테이블**로만 한다 — HTTP status 판정 금지.
* 근거: PROVIDER_ERROR는 400이지만 재시도 가능, REFUND_REJECTED는 400이지만 비재시도.
*/
interface TossApiFailure<Code extends string = string> {
readonly source: 'toss';
/** 토스 응답 {code, message} 원문 무손실 보존. */
readonly code: Code;
readonly message: string;
/** 보존하되 판정에 쓰지 않는다. */
readonly httpStatus: number;
readonly category: ErrorCategory;
/** ⚠ 코드 테이블 판정 — HTTP status 아님. */
readonly retryable: boolean;
/** x-tosspayments-trace-id */
readonly traceId: string | null;
}

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/toss-payments
  • Version: 0.6.1
  • Public entry: .
  • Source: GitHub