본문으로 건너뛰기

크레딧 원장

GET/v1/organizations/{org_id}/credit/ledger

충전, 과금, 만료, 철회, 조정 원장 행을 돌려줍니다

콘솔 세션 전용입니다, 조직 역할 owner, admin만 부를 수 있고 API 키로 부르면 403 console_only입니다

Headers

  • Cookie: string
    콘솔 로그인 세션 쿠키, 콘솔 전용 엔드포인트라 API 키로 부르면 403 console_only입니다

Parameters

  • org_id: string
    조직 ID
    형식 ^org_[A-Za-z0-9]+$
  • from: optional string
    UTC 날짜, 포함
  • to: optional string
    UTC 날짜, 포함
  • limit: optional integer
    한 페이지 크기
    기본값 20, 최소 1, 최대 100
  • cursor: optional string
    이전 응답의 next_cursor

Returns

200 application/json

  • LedgerList: object
    • data: array of LedgerEntry { id, kind, amount_micro_usd, … }
      항목 배열
      • id: string
        ID
      • kind: "topup" or "charge" or "expiry" or "withdrawal" or "adjust"
        topup(충전), charge(과금), expiry(만료), withdrawal(철회), adjust(조정)
      • amount_micro_usd: integer
        금액(µUSD), 차감은 음수
      • amount_usd: string
        같은 금액의 USD 문자열(센트, 소수 2자리)
        형식 ^-?[0-9]+\.[0-9]{2}$
      • balance_after_micro_usd: optional integer
        이 행 뒤의 잔액
        최소 0
      • balance_after_usd: optional string
        같은 금액의 USD 문자열(센트, 소수 2자리)
        형식 ^-?[0-9]+\.[0-9]{2}$
      • job_id: optional string or null
        과금 행이면 잡 ID
      • workspace_id: optional string or null
        워크스페이스 ID
      • api_key_id: optional string or null
        API 키 ID
      • topup_order_id: optional string or null
        충전 주문 ID
      • billed_minutes: optional integer or null
        과금 행이면 과금 분
      • created_at: string
        만든 시각
        RFC 3339 UTC 시각
      • memo: optional string or null
        메모
    • next_cursor: string or null
      다음 페이지 커서, 마지막이면 null

오류

  • invalid_request: HTTP 400
    본문이나 쿼리가 검증에 실패했습니다, error.details.fields에 문제 필드가 있습니다
  • session_required: HTTP 401
    콘솔 엔드포인트를 유효한 콘솔 세션 쿠키 없이 불렀습니다
  • console_only: HTTP 403
    콘솔 세션 전용 엔드포인트입니다, API 키로는 결제, 키, 멤버 관리를 할 수 없습니다
  • insufficient_permission: HTTP 403
    역할이나 키 권한(run/read)이 이 요청을 허용하지 않습니다
  • not_found: HTTP 404
    자원이 없거나 이 호출자에게 보이지 않습니다
  • rate_limited: HTTP 429, 다시 시도 가능
    이 키 또는 조직의 요청이 너무 많습니다, retry_after_s만큼 기다리세요
  • internal_error: HTTP 500, 다시 시도 가능
    예상하지 못한 오류입니다, 다시 시도하고 반복되면 request_id와 함께 알려 주세요

오류 봉투 모양과 전체 코드 표는 오류 코드에 있습니다

다음 단계