ToAPIsToAPIs
アカウント照会請求

請求書詳細の取得

システムアクセストークンで自身のアカウントデータを取得

GET
/api/v1/account/billing/invoices/%7Binvoice_id%7D

中国本土のユーザー向け: 中国本土のユーザーは https://toapis.cn を API エンドポイント (Base URL)としてご利用ください. 本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください.

認証, ページ分割, エラーは利用ガイドを参照してください.

動作

メインアカウント自身の請求情報のみ取得できます. サブアカウントは HTTP 403 になります. メンバーの請求情報は取得できません.

既定は 31 日, 最大 366 日. 現在確認済みの Customer のみ対象で meta.coverage=current_customer_only です. 対応変更で旧カーソルは無効になります. 金額は Stripe 通貨規則に従う 10 進文字列で, USD/CNY は 2 桁, JPY は 0 桁, KWD は 3 桁, ISK/UGX は互換の 2 桁です. subtotal/total は小計/合計, amount_due/amount_paid/amount_remaining は請求/支払済み/残額. 確実な注文関連がなければ platform_trade_no=null; number と paid_at も null 可. Customer ID, メール, 住所, 請求書 URL は返しません. 未関連は 409/15045, 読み取り失敗は 503/15046, 対応競合は 503/15047. エラーを空一覧に置換しません. 請求書とローカル入金は別です.

認証

Authorizationstringヘッダー必須

Bearer YOUR_SYSTEM_ACCESS_TOKEN を使用します. モデル API キーは使用できません. X-User-Id は不要です.

パラメータ

invoice_idstringパス必須

in_ で始まる Stripe 請求書 ID.

制約: maxLength=255; pattern=^in_[A-Za-z0-9_]+$.

リクエスト例

curl --request GET \
  --url 'https://toapis.com/api/v1/account/billing/invoices/in_example_01' \
  --header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'
import requests

response = requests.get(
    "https://toapis.com/api/v1/account/billing/invoices/in_example_01",
    headers={"Authorization": "Bearer YOUR_SYSTEM_ACCESS_TOKEN"},
    timeout=30,
)
response.raise_for_status()
print(response.json())
const url = new URL("https://toapis.com/api/v1/account/billing/invoices/in_example_01");

const response = await fetch(url, {
  headers: { Authorization: "Bearer YOUR_SYSTEM_ACCESS_TOKEN" },
  signal: AbortSignal.timeout(30_000),
});

if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
console.log(await response.json());

レスポンスフィールド

例は架空のデータで, credits_per_usd="100" を仮定しています. 実際の換算にはレスポンスの値を使用してください.

codeinteger

結果コード. 0 は成功です.

messagestring

成功時は空文字列です. エラーメッセージは翻訳されます.

dataobject

今回の照会結果オブジェクトです.

data.idstring

請求書詳細の取得に使う Stripe 請求書 ID です.

data.providerstring

決済サービスの提供元です. 固定値: "stripe".

data.numberstring | null

Stripe 請求書番号で, 請求書 ID とは異なります. 不明または対象外の場合は null です.

data.statusstring

Stripe が返した請求書の状態です.

data.created_atstring | null

作成時刻です. タイムゾーン付き RFC 3339 形式です. 不明または対象外の場合は null です.

data.currencystring

金額の元通貨です.

data.subtotalstring

請求書小計. currency の元通貨額です. 精度を保持するため 10 進文字列で返します.

data.totalstring

請求書総額. currency の元通貨額です. 精度を保持するため 10 進文字列で返します.

data.amount_duestring

請求書の支払必要額. 通貨は currency です. 精度を保持するため 10 進文字列で返します.

data.amount_paidstring

請求書の支払済み額. 通貨は currency です. 精度を保持するため 10 進文字列で返します.

data.amount_remainingstring

請求書の支払残額. 通貨は currency です. 精度を保持するため 10 進文字列で返します.

data.paid_atstring | null

Stripe に記録された請求書支払完了時刻です. タイムゾーン付き RFC 3339 形式です. 不明または対象外の場合は null です.

data.platform_trade_nonull

確実に関連するローカル注文番号. 関連を確認できなければ null です.

data.metaobject

データソース, 照会範囲, 集計基準などのメタデータです.

data.meta.sourcestring

データソースです. ローカル設定や台帳の値は Stripe のリアルタイム状態を意味しません. 固定値: "stripe".

data.meta.coveragestring

現在確認済みの Stripe Customer のみが対象で, 全履歴ではありません. 固定値: "current_customer_only".

data.meta.scopestring

照会対象の所有範囲で, 認証された自身のアカウントです. 固定値: "self".

data.meta.fetched_atstring

今回 Stripe から取得した時刻で, 請求書の作成時刻ではありません. タイムゾーン付き RFC 3339 形式です.

レスポンス例

{
  "code": 0,
  "message": "",
  "data": {
    "id": "in_example_01",
    "provider": "stripe",
    "number": "EXAMPLE-0001",
    "status": "paid",
    "created_at": "2026-11-01T08:00:00Z",
    "currency": "USD",
    "subtotal": "10",
    "total": "10",
    "amount_due": "10",
    "amount_paid": "10",
    "amount_remaining": "0",
    "paid_at": "2026-11-01T08:01:00Z",
    "platform_trade_no": null,
    "meta": {
      "source": "stripe",
      "coverage": "current_customer_only",
      "scope": "self",
      "fetched_at": "2026-11-02T01:00:00Z"
    }
  }
}