ToAPIsToAPIs
請求

請求書詳細の取得

請求書 ID で請求書の詳細を取得

GET
/api/v1/billing/stripe/invoices/{invoice_id}

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

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

動作

インボイス ID で Stripe 請求書 1 件の詳細を返します. 自身の請求を照会できるのは主アカウントのみで, サブアカウントは HTTP 403, 主アカウントも本エンドポイントでメンバー請求は参照できません.

レスポンスの請求書フィールドは一覧の各項目と同じで, data.meta に読み取りソース, Customer 対象範囲, 読み取り時刻が追加されます. 取得のたびに請求書が現在の Customer に属することを再検証し, 他人の請求書や存在しない請求書は 404 です.

hosted_invoice_url, invoice_pdf, Customer ID は返しません. フィールドの意味は請求書一覧を参照してください.

認証

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://api.toapis.com/api/v1/billing/stripe/invoices/in_example_01' \
  --header 'Authorization: Bearer YOUR_SYSTEM_ACCESS_TOKEN'
import requests

response = requests.get(
    "https://api.toapis.com/api/v1/billing/stripe/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://api.toapis.com/api/v1/billing/stripe/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"
    }
  }
}