{
  "components": {
    "schemas": {
      "BulkBatchResponse": {
        "properties": {
          "data": {
            "description": "一括注文の結果です。部分成功方式で、失敗行は他行を止めず、`done`行のみ課金します。LPA/QRは含まず、各`order_id`でGET /v1/orders/{id}から取得します。",
            "properties": {
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "external_ref": {
                "example": "batch-2026-001",
                "nullable": true,
                "type": "string"
              },
              "failed_lines": {
                "type": "integer"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "items": {
                "items": {
                  "$ref": "#/components/schemas/BulkLineResult"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "status": {
                "description": "`pending`は中断により未実行の行がある状態です。同じ`Idempotency-Key`で再度呼び出して残りを実行してください。",
                "enum": [
                  "pending",
                  "completed",
                  "partial",
                  "failed"
                ],
                "type": "string"
              },
              "succeeded_lines": {
                "type": "integer"
              },
              "total_charged": {
                "$ref": "#/components/schemas/Money"
              },
              "total_lines": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "BulkLineResult": {
        "properties": {
          "charged": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "nullable": true
          },
          "error": {
            "description": "実際の`domain.reason`エラーコード。例：`wallet.insufficient_balance`、`esim.out_of_stock`、`order.package_not_allowed`、`wallet.velocity_exceeded`。",
            "nullable": true,
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "external_ref": {
            "example": "po-1001",
            "nullable": true,
            "type": "string"
          },
          "line_no": {
            "description": "1始まりで、送信した順序と一致します。",
            "type": "integer"
          },
          "order_id": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "package_code": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "done",
              "failed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "BulkRequest": {
        "properties": {
          "external_ref": {
            "description": "バッチ全体の参照コードです。バッチ応答で返されます。",
            "example": "batch-2026-001",
            "nullable": true,
            "type": "string"
          },
          "items": {
            "description": "各要素は独立した注文を1件作成します。行数上限は設定可能（既定100）で、超過時は`internal.limit_exceeded`（422）。",
            "items": {
              "properties": {
                "external_ref": {
                  "description": "この行専用の参照コードです。行の結果にそのまま返されます。",
                  "example": "po-1001",
                  "nullable": true,
                  "type": "string"
                },
                "package_code": {
                  "description": "組織向けカタログのプランコード、すなわち`public_sku`です。供給元を切り替えてもプランごとに不変なので、照合キーに使えます。例は形式のみ正しく実際には使えません。`GET /v1/catalog/packages`から実コードを取得してください。",
                  "example": "TKE-VN-30D-X3K9F",
                  "type": "string"
                },
                "quantity": {
                  "example": 5,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "package_code",
                "quantity"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "CancelResponse": {
        "properties": {
          "data": {
            "properties": {
              "cancelled_at": {
                "format": "date-time",
                "type": "string"
              },
              "esim_id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "refund_suggested": {
                "description": "`true`は返金が担当者の承認待ちで、まだ送金されていない状態です。`refunded.amount = 0`を返金なしと解釈しないでください。",
                "type": "boolean"
              },
              "refunded": {
                "$ref": "#/components/schemas/Money",
                "description": "このキャンセルで実際にウォレットへ返金された金額です。本番では通常`0`のため、判断する前に`refund_suggested`を確認してください。"
              },
              "status": {
                "example": "cancelled",
                "type": "string"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "Cancellable": {
        "description": "eSIMの取消可否と不可の理由。`POST /v1/esims/{order_item_id}/cancel`の前に確認してください。回答のため常に存在し、`null`にはなりません。",
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "disclosed_at": {
            "description": "コードがシステム外に出た時刻（ISO-8601 UTC）。誰も見ていない間は`null`です。未受領を理由に取消不可を争う場合の確認記録です。",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "取消不可の理由：`code_disclosed`（送信・表示済み）、`wrong_status`（状態不適合）、`expired`（期限切れ）、`not_supported`（取消機能未宣言）。`allowed = true`なら`null`。`esim.not_cancellable`の`meta.reason`と同じ用語です。",
            "enum": [
              "code_disclosed",
              "wrong_status",
              "expired",
              "not_supported",
              null
            ],
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChangePlanRequest": {
        "properties": {
          "package_code": {
            "description": "組織向けカタログのプランコード、すなわち`public_sku`です。供給元を切り替えてもプランごとに不変なので、照合キーに使えます。例は形式のみ正しく実際には使えません。`GET /v1/catalog/packages`から実コードを取得してください。",
            "example": "TKE-VN-7D-P4M2Q",
            "type": "string"
          }
        },
        "required": [
          "package_code"
        ],
        "type": "object"
      },
      "ChangePlanResponse": {
        "properties": {
          "data": {
            "description": "eSIMプラン変更の結果です。",
            "properties": {
              "charged": {
                "$ref": "#/components/schemas/Money"
              },
              "current_plan": {
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "expires_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "started_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "esim_id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "order_id": {
                "format": "uuid",
                "type": "string"
              },
              "previous_plan": {
                "nullable": true,
                "properties": {
                  "cancelled_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "remaining_bytes_forfeited": {
                    "format": "int64",
                    "nullable": true,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "warning": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "CreateOrderRequest": {
        "properties": {
          "external_ref": {
            "description": "応答とWebhookにそのまま返す任意の参照コード。",
            "example": "po-1001",
            "nullable": true,
            "type": "string"
          },
          "include": {
            "description": "追加ブロック：`[\"lpa\"]`または`[\"lpa\",\"qr\"]`。省略すると`items[].install`は`null`で、すべてのeSIMの取消権を維持します。**コードの返却は開示です**。`lpa`を指定すると注文時点で取消可能期間が終了します。",
            "example": [
              "lpa"
            ],
            "items": {
              "enum": [
                "lpa",
                "qr"
              ],
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "invoice_buyer": {
            "$ref": "#/components/schemas/MemberInvoiceBuyer"
          },
          "items": {
            "description": "購入するプランと数量の一覧です（eSIMは最大50件）。",
            "items": {
              "properties": {
                "package_code": {
                  "description": "組織向けカタログのプランコード、すなわち`public_sku`です。供給元を切り替えてもプランごとに不変なので、照合キーに使えます。例は形式のみ正しく実際には使えません。`GET /v1/catalog/packages`から実コードを取得してください。",
                  "example": "TKE-VN-30D-X3K9F",
                  "type": "string"
                },
                "quantity": {
                  "description": "このプランで購入するeSIMの数量（≥ 1）。",
                  "example": 2,
                  "type": "integer"
                }
              },
              "required": [
                "package_code",
                "quantity"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "CreateWebhookResponse": {
        "properties": {
          "data": {
            "properties": {
              "active": {
                "description": "`false`は新規イベント停止を表し、画面からの一時停止かAPIキー失効時に同じトランザクションで停止します。CHECK_HEALTHに合格した`PUT /v1/webhooks/{id}`で再開します。",
                "type": "boolean"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "events": {
                "description": "空の場合はすべて受信します。",
                "items": {
                  "enum": [
                    "order.completed",
                    "order.failed",
                    "esim.delivered",
                    "esim.activated",
                    "esim.usage_threshold",
                    "esim.expiring",
                    "wallet.low_balance",
                    "catalog.updated"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "health_check": {
                "enum": [
                  "passed"
                ],
                "type": "string"
              },
              "id": {
                "description": "`/v1/webhooks/{id}`に指定するエンドポイントIDです。作成ごとに新規発行され、削除後の再作成は元の復活ではなく別エンドポイントになります。",
                "format": "uuid",
                "type": "string"
              },
              "last_delivery_at": {
                "description": "このエンドポイントで最後に送信した時刻です。`null`は送信失敗ではなく未送信であり、パートナーがWebhook未受信を報告した際に最初に確認します。",
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "secret_last4": {
                "description": "Webhookシークレットの末尾4文字です。秘密全体を再公開せず、手元の鍵が署名に使われるものか確認できます。全体は作成時に1回だけ表示します。",
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "webhook_secret": {
                "description": "作成時に1回だけ表示します（接頭辞`whsec_`）。",
                "type": "string"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "DeleteWebhookResponse": {
        "properties": {
          "data": {
            "properties": {
              "deleted_at": {
                "format": "date-time",
                "type": "string"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "Delivery": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_id": {
            "description": "イベント識別子です。再送では同じ`event_id`を持つ新しい送信が作成されます。送信の`id`ではなく`event_id`で重複排除してください。",
            "format": "uuid",
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "next_retry_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "response_code": {
            "nullable": true,
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "delivered",
              "failed"
            ],
            "type": "string"
          },
          "webhook_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DeliveryListResponse": {
        "properties": {
          "data": {
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "nullable": true,
                "type": "integer"
              },
              "total": {
                "description": "条件に一致する件数です。集計コストが高い場合は`null`になります。終端の判定には使用せず、`next_cursor`を確認してください。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "DeliveryReplayResponse": {
        "properties": {
          "data": {
            "properties": {
              "attempts": {
                "type": "integer"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "event_id": {
                "description": "イベント識別子です。再送では同じ`event_id`を持つ新しい送信が作成されます。送信の`id`ではなく`event_id`で重複排除してください。",
                "format": "uuid",
                "type": "string"
              },
              "event_type": {
                "type": "string"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "last_attempt_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_retry_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "response_code": {
                "nullable": true,
                "type": "integer"
              },
              "status": {
                "enum": [
                  "pending",
                  "delivered",
                  "failed"
                ],
                "type": "string"
              },
              "webhook_id": {
                "format": "uuid",
                "type": "string"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "ErrorEnvelope": {
        "properties": {
          "error": {
            "properties": {
              "code": {
                "description": "`domain.reason`形式のコード（エラーコード表を参照）。",
                "type": "string"
              },
              "field": {
                "nullable": true,
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "meta": {
                "nullable": true,
                "type": "object"
              },
              "request_id": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "type": "object"
          },
          "ok": {
            "enum": [
              false
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "error"
        ],
        "type": "object"
      },
      "Esim": {
        "properties": {
          "data": {
            "properties": {
              "cancellable": {
                "$ref": "#/components/schemas/Cancellable"
              },
              "external_ref": {
                "description": "注文時に送信した`external_ref`で、eSIMと注文を照合します。未指定で注文した場合は`null`。",
                "nullable": true,
                "type": "string"
              },
              "iccid": {
                "example": "8984012345678901234",
                "nullable": true,
                "type": "string"
              },
              "id": {
                "description": "全`/v1/esims/{id}/…`パスで使うeSIM IDで、Webhookの`order_item_id`でもあります。ICCIDのみ分かる場合は`GET /v1/esims?iccid=…`で`id`を取得します。",
                "format": "uuid",
                "type": "string"
              },
              "install": {
                "$ref": "#/components/schemas/Install"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "msisdn": {
                "nullable": true,
                "type": "string"
              },
              "order_id": {
                "format": "uuid",
                "type": "string"
              },
              "package_code": {
                "description": "カタログのプランコードで、eSIMをカタログに紐付けるキーです。元プランがカタログから削除された場合のみ`null`です。",
                "nullable": true,
                "type": "string"
              },
              "package_name": {
                "description": "表示用の名称で、変更される場合があります。照合キーには使用しないでください。",
                "type": "string"
              },
              "plan": {
                "$ref": "#/components/schemas/PlanView"
              },
              "smdp_status": {
                "example": "released",
                "nullable": true,
                "type": "string"
              },
              "status": {
                "example": "delivered",
                "type": "string"
              },
              "updated_at": {
                "format": "date-time",
                "type": "string"
              },
              "usage": {
                "$ref": "#/components/schemas/Usage"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "EsimItem": {
        "properties": {
          "cancellable": {
            "$ref": "#/components/schemas/Cancellable"
          },
          "external_ref": {
            "description": "注文時に送信した`external_ref`で、eSIMと注文を照合します。未指定で注文した場合は`null`。",
            "nullable": true,
            "type": "string"
          },
          "iccid": {
            "example": "8984012345678901234",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "全`/v1/esims/{id}/…`パスで使うeSIM IDで、Webhookの`order_item_id`でもあります。ICCIDのみ分かる場合は`GET /v1/esims?iccid=…`で`id`を取得します。",
            "format": "uuid",
            "type": "string"
          },
          "install": {
            "$ref": "#/components/schemas/Install"
          },
          "msisdn": {
            "nullable": true,
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "type": "string"
          },
          "package_code": {
            "description": "カタログのプランコードで、eSIMをカタログに紐付けるキーです。元プランがカタログから削除された場合のみ`null`です。",
            "nullable": true,
            "type": "string"
          },
          "package_name": {
            "description": "表示用の名称で、変更される場合があります。照合キーには使用しないでください。",
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanView"
          },
          "smdp_status": {
            "example": "released",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "example": "delivered",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "type": "object"
      },
      "EsimListResponse": {
        "properties": {
          "data": {
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/EsimItem"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "nullable": true,
                "type": "integer"
              },
              "total": {
                "description": "条件に一致する件数です。集計コストが高い場合は`null`になります。終端の判定には使用せず、`next_cursor`を確認してください。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "EsimUsage": {
        "properties": {
          "data": {
            "properties": {
              "esim_id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "usage": {
                "$ref": "#/components/schemas/Usage"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "Install": {
        "description": "このeSIMのインストールに必要なすべての情報です。`null`は未要求（`include=lpa`なし）を意味します。まだコードがない場合とは異なり、その場合はブロックが存在して`lpa: null`になります。\n\nこのブロックを含む応答には常に`Cache-Control: no-store`が付きます。",
        "nullable": true,
        "properties": {
          "android_url": {
            "nullable": true,
            "type": "string"
          },
          "apn": {
            "description": "自動設定できないときに入力するアクセスポイント名（APN）です。現バージョンでは常に`null`で、不明を意味し、不要という意味ではありません。",
            "nullable": true,
            "type": "string"
          },
          "ios_url": {
            "nullable": true,
            "type": "string"
          },
          "lpa": {
            "description": "eSIMのアクティベーションコードで、販売可能な秘密情報です。この文字列だけでQRコードを生成できます。",
            "example": "LPA:1$smdp.example.com$MATCH-ABC123",
            "nullable": true,
            "type": "string"
          },
          "matching_id": {
            "example": "MATCH-ABC123",
            "nullable": true,
            "type": "string"
          },
          "qr_code_base64": {
            "description": "QRコードのPNGデータURIです。詳細エンドポイントで`include=qr`を指定した場合のみ存在し、一覧には含みません（1行約11KB、100行で約1.1MB）。`lpa`からQRコードを生成してください。",
            "nullable": true,
            "type": "string"
          },
          "smdp_address": {
            "example": "smdp.example.com",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ListWarning": {
        "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
        "properties": {
          "code": {
            "enum": [
              "filtered_by_key_package_filters",
              "filtered_by_provider_scope",
              "no_price_for_org",
              "price_filter_removed_rows",
              "provider_disabled",
              "capability_missing"
            ],
            "example": "no_price_for_org",
            "type": "string"
          },
          "count": {
            "example": 12,
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "message": {
            "example": "12 gói bị lược vì tổ chức bạn chưa có giá.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "MemberInvoiceBuyer": {
        "description": "メンバーキー専用です。未指定なら組織やベトナム法人を必要としない消費者フローを使用します。指定時はfull_name、12桁の個人tax_code、購入時のaddress/email規則で検証します。企業向け請求書は購入後に申請します。テストモードではスナップショットの検証のみ行い、MISA請求書は発行しません。",
        "nullable": true,
        "properties": {
          "address": {
            "nullable": true,
            "type": "string"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "full_name": {
            "nullable": true,
            "type": "string"
          },
          "legal_name": {
            "nullable": true,
            "type": "string"
          },
          "tax_code": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "MemberRefundRequest": {
        "properties": {
          "decided_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "decision_note": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "type": "string"
          },
          "order_item_id": {
            "format": "uuid",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "refunded": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "nullable": true
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "suggested": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "type": "object"
      },
      "MemberRefundRequestInput": {
        "properties": {
          "reason": {
            "description": "前後の空白を除去した後、5〜1000文字の返金理由。",
            "maxLength": 1000,
            "minLength": 5,
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "MemberRefundRequestListResponse": {
        "properties": {
          "data": {
            "properties": {
              "has_open_request": {
                "type": "boolean"
              },
              "items": {
                "items": {
                  "$ref": "#/components/schemas/MemberRefundRequest"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "nullable": true,
                "type": "integer"
              },
              "total": {
                "description": "条件に一致する件数です。集計コストが高い場合は`null`になります。終端の判定には使用せず、`next_cursor`を確認してください。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "MemberRefundRequestResponse": {
        "properties": {
          "data": {
            "properties": {
              "decided_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "decision_note": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "order_id": {
                "format": "uuid",
                "type": "string"
              },
              "order_item_id": {
                "format": "uuid",
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "refunded": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Money"
                  }
                ],
                "nullable": true
              },
              "requested_at": {
                "format": "date-time",
                "type": "string"
              },
              "status": {
                "enum": [
                  "pending",
                  "approved",
                  "rejected"
                ],
                "type": "string"
              },
              "suggested": {
                "$ref": "#/components/schemas/Money"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "ModeEcho": {
        "description": "呼び出しキーの環境で、X-TKE-Modeヘッダーと一致します。組織はtke_live_/tke_test_、メンバーはtke_member_live_/tke_member_test_を使用します。本番とテストのホストはキーモードを検証します。",
        "enum": [
          "test",
          "live"
        ],
        "example": "live",
        "type": "string"
      },
      "Money": {
        "description": "金額。`/v1`全体で同じ形式を使用し、オブジェクトと数値を切り替えません。",
        "properties": {
          "amount": {
            "description": "`currency`の最小単位で表す整数です（VNDに補助単位はありません）。",
            "example": 273000,
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "example": "VND",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OkEnvelope": {
        "properties": {
          "data": {
            "description": "ペイロードはエンドポイントごとに異なります。",
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "OrderItem": {
        "properties": {
          "cancellable": {
            "$ref": "#/components/schemas/Cancellable"
          },
          "external_ref": {
            "description": "注文時に送信した`external_ref`で、eSIMと注文を照合します。未指定で注文した場合は`null`。",
            "nullable": true,
            "type": "string"
          },
          "iccid": {
            "example": "8984012345678901234",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "全`/v1/esims/{id}/…`パスで使うeSIM IDで、Webhookの`order_item_id`でもあります。ICCIDのみ分かる場合は`GET /v1/esims?iccid=…`で`id`を取得します。",
            "format": "uuid",
            "type": "string"
          },
          "install": {
            "$ref": "#/components/schemas/Install"
          },
          "msisdn": {
            "nullable": true,
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "type": "string"
          },
          "package_code": {
            "description": "カタログのプランコードで、eSIMをカタログに紐付けるキーです。元プランがカタログから削除された場合のみ`null`です。",
            "nullable": true,
            "type": "string"
          },
          "package_name": {
            "description": "表示用の名称で、変更される場合があります。照合キーには使用しないでください。",
            "type": "string"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanView"
          },
          "smdp_status": {
            "example": "released",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "example": "delivered",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "type": "object"
      },
      "OrderListItem": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "external_ref": {
            "example": "po-1001",
            "nullable": true,
            "type": "string"
          },
          "fulfillment_status": {
            "enum": [
              "fulfilled",
              "partially_fulfilled",
              "unfulfilled"
            ],
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "item_count": {
            "format": "int64",
            "type": "integer"
          },
          "net": {
            "$ref": "#/components/schemas/Money"
          },
          "public_ref": {
            "example": "TKE-DH-2A4C7Q",
            "nullable": true,
            "type": "string"
          },
          "refunded": {
            "$ref": "#/components/schemas/Money"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderListResponse": {
        "properties": {
          "data": {
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/OrderListItem"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "nullable": true,
                "type": "integer"
              },
              "total": {
                "description": "条件に一致する件数です。集計コストが高い場合は`null`になります。終端の判定には使用せず、`next_cursor`を確認してください。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "OrderResponse": {
        "properties": {
          "data": {
            "description": "パートナー注文。",
            "properties": {
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "external_ref": {
                "example": "po-1001",
                "nullable": true,
                "type": "string"
              },
              "fulfillment_status": {
                "description": "実際の納品状況で、`status`とは別の軸です。3件中2件が納品、1件が失敗した場合も`status=completed`ですが、`fulfillment_status=partially_fulfilled`、`refunded_amount > 0`になります。",
                "enum": [
                  "fulfilled",
                  "partially_fulfilled",
                  "unfulfilled"
                ],
                "type": "string"
              },
              "id": {
                "description": "注文ID（UUID）。",
                "format": "uuid",
                "type": "string"
              },
              "idempotent_replay": {
                "description": "過去の成功を冪等に再実行した場合に真となります。",
                "nullable": true,
                "type": "boolean"
              },
              "invoice_no": {
                "description": "発行後の請求書番号です。",
                "nullable": true,
                "type": "string"
              },
              "invoice_status": {
                "description": "注文のVAT請求書状態です。`none`は未発行です。",
                "enum": [
                  "none",
                  "pending",
                  "issuing",
                  "issued",
                  "failed",
                  "cancelled"
                ],
                "type": "string"
              },
              "items": {
                "items": {
                  "$ref": "#/components/schemas/OrderItem"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "money_settled": {
                "description": "注文金額が精算済みか（返金処理中でないか）。`false`の場合は請求書を発行できません。",
                "type": "boolean"
              },
              "net": {
                "$ref": "#/components/schemas/Money"
              },
              "public_ref": {
                "description": "サポートへの問い合わせに使用する短い注文コードです。",
                "example": "TKE-DH-2A4C7Q",
                "nullable": true,
                "type": "string"
              },
              "refunded": {
                "$ref": "#/components/schemas/Money"
              },
              "status": {
                "enum": [
                  "completed",
                  "pending_provider",
                  "provider_failed",
                  "cancelled"
                ],
                "type": "string"
              },
              "total": {
                "$ref": "#/components/schemas/Money"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "Package": {
        "description": "**`null`は不明を表し、肯定でも否定でもありません。** 空の項目から保証を推測しないでください。`true`/`false`と`features.apps[]`に存在する項目のみが供給元の宣言です。",
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/PackageCapabilities"
          },
          "code": {
            "description": "組織向けカタログのプランコード、すなわち`public_sku`です。供給元を切り替えてもプランごとに不変なので、照合キーに使えます。例は形式のみ正しく実際には使えません。`GET /v1/catalog/packages`から実コードを取得してください。",
            "example": "TKE-VN-30D-X3K9F",
            "type": "string"
          },
          "coverage": {
            "description": "プランの利用可能地域。",
            "properties": {
              "countries": {
                "description": "ISO-3166 alpha-2コードです。グローバルプラン（200か国を列挙しません）および対象国の宣言がないプランでは空になります。",
                "example": [
                  "CN"
                ],
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "country_count": {
                "description": "全件取得して配列を数えることなく、複数国対応プランを並べ替え・絞り込みできる対象国数です。",
                "example": 1,
                "type": "integer"
              },
              "group": {
                "description": "対象範囲：国（`country`）、地域（`region`）、世界（`global`）。オープン列挙型のため不明な値は無視してください。",
                "example": "country",
                "type": "string"
              },
              "region": {
                "description": "常に`null`です。地域はプランではなく国に関連付けられます。`?region=`での絞り込みは利用できます。",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "data": {
            "description": "プランのデータ容量です。二重丸めを避けるため、すべてMB・GBではなく**バイト**単位です。",
            "properties": {
              "daily_bytes": {
                "description": "1日あたりのデータ容量（バイト）です。`fixed`・`unlimited`プランでは`null`です。",
                "example": 1073741824,
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "label": {
                "description": "全画面と同じ関数で生成される、人が読める表示名です。",
                "example": "1GB/ngày",
                "type": "string"
              },
              "model": {
                "description": "容量計測方式：`daily`（1日単位）、`fixed`（全期間の総量）、`unlimited`。拡張可能な列挙型のため、クライアントは不明な値を無視してください。",
                "enum": [
                  "daily",
                  "fixed",
                  "unlimited"
                ],
                "example": "daily",
                "type": "string"
              },
              "reset": {
                "description": "日次容量のリセット時点。夜遅く購入した場合の初日分に影響する販売情報です。`null`は未宣言。",
                "nullable": true,
                "properties": {
                  "at": {
                    "description": "`timezone`の現地時刻でのリセット時刻です（`00:00`、`00:00:01`）。",
                    "example": "00:00",
                    "nullable": true,
                    "type": "string"
                  },
                  "note": {
                    "nullable": true,
                    "type": "string"
                  },
                  "timezone": {
                    "description": "リセット時刻のタイムゾーン（`UTC+8`、`UTC+7`）。",
                    "example": "UTC+8",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "total_bytes": {
                "description": "全期間の総容量（バイト）。`daily`/`unlimited`では`null`です。日次容量と日数を掛けても供給元が保証する総量にはなりません。",
                "example": null,
                "format": "int64",
                "nullable": true,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "description": {
            "description": "プランの販売用説明。未作成の場合は`null`。",
            "nullable": true,
            "type": "string"
          },
          "description_en": {
            "description": "英語の説明。未提供の場合は`null`。",
            "nullable": true,
            "type": "string"
          },
          "features": {
            "description": "機能をコード配列ではなく型付きオブジェクトで表します。`[]`ではテザリング非対応と不明を区別できませんが、`false`と`null`なら区別できます。",
            "properties": {
              "apps": {
                "description": "OS別のアプリ対応状況です。\n\n**配列に存在しないアプリは情報不明であり、対応を意味しません。** 一覧にあるものだけが供給元の宣言で、現在はTikTokのみです。\n\n統合フィールドを設けないのは意図的です。実際のカタログでは2,465プランがiPhoneでTikTokに対応しますが、Androidでは非対応です。単一のフラグで「非対応」にまとめると、カタログの約3分の1を誤って扱うことになります。",
                "items": {
                  "properties": {
                    "android": {
                      "description": "`supported`（対応宣言）、`blocked`（非対応宣言）、`unknown`（このOSの宣言なし）。オープン列挙型。",
                      "enum": [
                        "supported",
                        "blocked",
                        "unknown"
                      ],
                      "example": "blocked",
                      "type": "string"
                    },
                    "app": {
                      "description": "小文字のアプリコード（例：`tiktok`）。",
                      "example": "tiktok",
                      "type": "string"
                    },
                    "ios": {
                      "description": "`supported`（対応宣言）、`blocked`（非対応宣言）、`unknown`（このOSの宣言なし）。オープン列挙型。",
                      "enum": [
                        "supported",
                        "blocked",
                        "unknown"
                      ],
                      "example": "supported",
                      "type": "string"
                    },
                    "note": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "hotspot": {
                "description": "他の機器へのWi-Fi共有。`null`は未宣言で、`false`とは異なります。",
                "example": true,
                "nullable": true,
                "type": "boolean"
              },
              "kyc_required": {
                "description": "利用前に本人確認（KYC）が必要です。`null`は未宣言です。",
                "example": false,
                "nullable": true,
                "type": "boolean"
              },
              "sms": {
                "description": "SMS。`false`はSMSを受信できず、銀行のワンタイムパスワードも受信できません。`null`は未宣言です。",
                "example": false,
                "nullable": true,
                "type": "boolean"
              },
              "voice": {
                "description": "音声通話。`false`は供給元が音声非対応を宣言しており、データ専用回線は着信できません。`null`は未宣言。",
                "example": false,
                "nullable": true,
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "fup": {
            "description": "高速容量を使い切った後の動作。`null`は速度制限の方針が未宣言です。",
            "nullable": true,
            "properties": {
              "behavior": {
                "description": "`throttle`（減速）、`cutoff`（切断）、`null`（未宣言）。オープン列挙型。",
                "enum": [
                  "throttle",
                  "cutoff",
                  null
                ],
                "nullable": true,
                "type": "string"
              },
              "high_speed_bytes": {
                "description": "速度制限が始まるまでの高速通信量（バイト）。",
                "example": 1048576,
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "note": {
                "nullable": true,
                "type": "string"
              },
              "speed_kbps": {
                "description": "高速容量消費後の速度（kbps）です。回線停止または未宣言なら`null`です。プラン全体の速度上限`network.speed_cap_kbps`とは異なります。",
                "example": 128,
                "nullable": true,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "market": {
            "description": "プランの供給システムです。拡張可能な列挙型のため不明値は無視してください。在庫の有無と販売後操作を決定します。`domestic`はキットを販売し、追加・取消・使用量照会に対応します。`international`は要求時に供給元へ注文するため在庫がありません。",
            "enum": [
              "domestic",
              "international"
            ],
            "example": "international",
            "type": "string"
          },
          "name": {
            "example": "eSIM Trung Quốc Mainland Multi - 1GB/ngày - 24 ngày",
            "type": "string"
          },
          "name_en": {
            "description": "英語名。未提供の場合は`null`。",
            "nullable": true,
            "type": "string"
          },
          "network": {
            "description": "プランが利用する通信網。",
            "properties": {
              "apn": {
                "description": "自動設定できない一部のAndroid端末で手動入力するAPNです。インストール手順に必要で、情報がなければ個別のサポート対応が必要になります。`null`は未宣言です。",
                "example": "e-ideas",
                "nullable": true,
                "type": "string"
              },
              "carriers": {
                "description": "このプランが使用する通信事業者です。供給元ではなく、利用する無線ネットワークというeSIMの仕様です。",
                "items": {
                  "properties": {
                    "name": {
                      "example": "China Unicom",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "generations": {
                "description": "利用可能な通信世代（`[\"4g\", \"5g\"]`）です。`null`は未宣言であり、2G専用という意味ではありません。",
                "example": [
                  "4g",
                  "5g"
                ],
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              },
              "speed_cap_kbps": {
                "description": "プラン全体の速度上限（kbps）です。高速容量消費後に適用する`fup.speed_kbps`とは異なります。",
                "nullable": true,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "price": {
            "$ref": "#/components/schemas/Money",
            "description": "組織がAPIで支払う価格で、`POST /v1/orders`の請求額と一致します。常に`{amount, currency}`オブジェクトで、数値のみにはなりません。仕入れ原価は公開しません。"
          },
          "tags": {
            "description": "小文字・ハイフンで正規化した商品タグです。キーのカタログ制限にも使用します。現在タグ付きプランはなく、販売者が付与するまで`?tag=`は空一覧を返します。",
            "example": [],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "validity": {
            "description": "プランの有効期間と計測開始時点です。",
            "properties": {
              "days": {
                "example": 24,
                "type": "integer"
              },
              "install_by_days": {
                "description": "購入後にQRコードを読み取り、eSIMをインストールできる日数です。`null`は未宣言であり、いつでもインストール可能という意味ではありません。",
                "example": 365,
                "nullable": true,
                "type": "integer"
              },
              "label": {
                "example": "24 ngày",
                "type": "string"
              },
              "reclaim_on_expiry": {
                "description": "期限切れ時に供給元が契約を回収するため、追加チャージや変更ができなくなります。更新を販売する場合に重要です。`null`は未宣言。",
                "example": true,
                "nullable": true,
                "type": "boolean"
              },
              "starts_when": {
                "description": "計測開始：`on_install`（インストール時）、`on_purchase`（購入時）、または`null`。有効期限の算出に重要です。`null`なら具体的な期限を約束しないでください。",
                "enum": [
                  "on_install",
                  "on_purchase",
                  null
                ],
                "example": "on_install",
                "nullable": true,
                "type": "string"
              },
              "unused_valid_days": {
                "description": "未使用で保管できる期限までの日数です。`null`は未宣言であり、無期限ではありません。保管期限とインストール期限は異なるため、`install_by_days`とは別です。",
                "nullable": true,
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "PackageCapabilities": {
        "description": "供給元の種類から推測せず、プランが実際に宣言した購入後の機能です。宣言がない場合は全項目`false`とし、必ず`422 capability.not_supported`になる操作を約束しません。",
        "properties": {
          "cancel": {
            "properties": {
              "restriction": {
                "description": "`code_not_disclosed`は誰もコードを見ていない場合のみ取消可能という意味です（顧客送信、画面表示、`?include=lpa`も含む）。実際の取消条件であり、システムが把握できないインストール有無を示しません。旧`unused_only`は不正確な表現でした。",
                "enum": [
                  "code_not_disclosed",
                  null
                ],
                "nullable": true,
                "type": "string"
              },
              "supported": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "plan_change": {
            "properties": {
              "policy": {
                "$ref": "#/components/schemas/PlanChangePolicy"
              },
              "supported": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "usage_check": {
            "properties": {
              "supported": {
                "type": "boolean"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "PackageDetail": {
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Package"
              },
              {
                "properties": {
                  "mode": {
                    "$ref": "#/components/schemas/ModeEcho"
                  }
                },
                "type": "object"
              }
            ]
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "PackageListResponse": {
        "properties": {
          "data": {
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/Package"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "nullable": true,
                "type": "integer"
              },
              "total": {
                "description": "条件に一致する総プラン数。国際向けや`market`未指定など集計が高コストな場合は`null`。キー制限と組織価格の判定前に集計するため、購入可能数ではなくカタログの一致数です。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "PlanChangePolicy": {
        "description": "この供給元で新しいプランを追加チャージする際の動作です。`null`はチャージ不可、または供給元の方針を未確認であることを示します。推測してはいけません。すべて`false`のオブジェクトは何もキャンセルしない保証となり、`null`とは意味が異なります。",
        "nullable": true,
        "properties": {
          "note": {
            "nullable": true,
            "type": "string"
          },
          "requires_cancel_first": {
            "description": "この供給元はプランを積み重ねないため、新規注文前に利用中のプランがキャンセルされます。追加チャージボタンを押す前に顧客へ説明してください。",
            "type": "boolean"
          },
          "stacking": {
            "description": "新プランの期間と容量を現行プランに加算するかどうか。",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PlanOptionsResponse": {
        "properties": {
          "data": {
            "description": "このeSIMの供給元で絞り込んだ追加チャージ用プランです。各要素はカタログと同じ完全な`Package`です。`policy`は現在の供給元の方針で、`null`は未確認を表し、取り消しがないという意味ではありません。",
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/Package"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "type": "integer"
              },
              "policy": {
                "$ref": "#/components/schemas/PlanChangePolicy"
              },
              "total": {
                "description": "条件に一致する総プラン数。国際向けや`market`未指定など集計が高コストな場合は`null`。キー制限と組織価格の判定前に集計するため、購入可能数ではなくカタログの一致数です。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "PlanView": {
        "description": "このeSIMに現在適用されているプラン。",
        "nullable": true,
        "properties": {
          "current_code": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResendResponse": {
        "properties": {
          "data": {
            "properties": {
              "id": {
                "description": "再送した注文のIDです。",
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "resent_at": {
                "format": "date-time",
                "type": "string"
              },
              "resent_to": {
                "description": "一部を伏せた受信先アドレス。パートナー向けには顧客の完全なメールアドレスを再表示しません。",
                "example": "ab***@x.com",
                "type": "string"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "SimulateRequest": {
        "properties": {
          "data": {
            "description": "サンプルペイロードの`data`フィールドを部分的に上書きします。",
            "type": "object"
          }
        },
        "type": "object"
      },
      "SimulateResponse": {
        "properties": {
          "data": {
            "properties": {
              "delivery_id": {
                "format": "uuid",
                "type": "string"
              },
              "event_id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "TestModeEsimState": {
        "properties": {
          "data": {
            "properties": {
              "cancellable": {
                "$ref": "#/components/schemas/Cancellable"
              },
              "external_ref": {
                "description": "注文時に送信した`external_ref`で、eSIMと注文を照合します。未指定で注文した場合は`null`。",
                "nullable": true,
                "type": "string"
              },
              "iccid": {
                "example": "8984012345678901234",
                "nullable": true,
                "type": "string"
              },
              "id": {
                "description": "全`/v1/esims/{id}/…`パスで使うeSIM IDで、Webhookの`order_item_id`でもあります。ICCIDのみ分かる場合は`GET /v1/esims?iccid=…`で`id`を取得します。",
                "format": "uuid",
                "type": "string"
              },
              "install": {
                "$ref": "#/components/schemas/Install"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "msisdn": {
                "nullable": true,
                "type": "string"
              },
              "order_id": {
                "format": "uuid",
                "type": "string"
              },
              "package_code": {
                "description": "カタログのプランコードで、eSIMをカタログに紐付けるキーです。元プランがカタログから削除された場合のみ`null`です。",
                "nullable": true,
                "type": "string"
              },
              "package_name": {
                "description": "表示用の名称で、変更される場合があります。照合キーには使用しないでください。",
                "type": "string"
              },
              "plan": {
                "$ref": "#/components/schemas/PlanView"
              },
              "simulated": {
                "description": "シナリオ適用後のシミュレーション状態。",
                "properties": {
                  "esim_state": {
                    "description": "テストeSIMの技術的ライフサイクルです。本番では`smdp_status`から取得しますが、テストeSIMにはSM-DP+プロファイルがないため、テスト専用項目とともにここに置きます。",
                    "enum": [
                      "released",
                      "installed",
                      "enabled",
                      "disabled"
                    ],
                    "type": "string"
                  },
                  "last_via": {
                    "description": "このeSIMに最後に変更を加えた処理経路です。",
                    "enum": [
                      "open_api",
                      "simulate",
                      "seed"
                    ],
                    "type": "string"
                  },
                  "via": {
                    "description": "このテストeSIMを作成した処理経路です。",
                    "enum": [
                      "open_api",
                      "simulate",
                      "seed"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "smdp_status": {
                "example": "released",
                "nullable": true,
                "type": "string"
              },
              "status": {
                "example": "delivered",
                "type": "string"
              },
              "updated_at": {
                "format": "date-time",
                "type": "string"
              },
              "usage": {
                "$ref": "#/components/schemas/Usage"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "TestModeFailNextRequest": {
        "properties": {
          "count": {
            "default": 1,
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TestModeFailNextResponse": {
        "properties": {
          "data": {
            "properties": {
              "endpoint_id": {
                "format": "uuid",
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "testmode_fail_next": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "TestModeReset": {
        "properties": {
          "data": {
            "properties": {
              "esim_states_deleted": {
                "format": "int64",
                "type": "integer"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "order_items_deleted": {
                "format": "int64",
                "type": "integer"
              },
              "orders_deleted": {
                "format": "int64",
                "type": "integer"
              },
              "wallet_balance": {
                "description": "リセット後のテストウォレット残高で、常に0です。元帳は削除せず、相殺仕訳で残高をゼロにします。",
                "format": "int64",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "TestModeResetInput": {
        "properties": {
          "reason": {
            "example": "Reset test data",
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "TestModeSeed": {
        "properties": {
          "data": {
            "properties": {
              "already_seeded": {
                "type": "boolean"
              },
              "esims_created": {
                "type": "integer"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "orders_created": {
                "type": "integer"
              },
              "seeded": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "TestModeSimulateRequest": {
        "description": "適用するシナリオ。全項目は任意ですが、最低1つが必須です。空の本文は成功ではなく`422 testmode.invalid_scenario`を返します。",
        "properties": {
          "data_used_mb": {
            "description": "使用済みデータ量（MB、1 MiBの2進単位）。容量を超える値は上限に丸められ、データ使い切りのシナリオとなります。エラーではありません。",
            "example": 4096,
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "expire_at": {
            "description": "有効期限の日時を指定します（ISO-8601 UTC）。",
            "format": "date-time",
            "type": "string"
          },
          "expire_now": {
            "description": "`true`でプランを即時失効（`esim_status`が`expired`になる）。",
            "type": "boolean"
          },
          "provider_reject": {
            "description": "次の操作（追加／キャンセル）で供給元の拒否をシミュレーションします。",
            "type": "boolean"
          },
          "status": {
            "description": "供給元の用語によるeSIMプロファイルの技術的ライフサイクルです。eSIM取得APIの業務上の`esim_status`とは異なります。",
            "enum": [
              "released",
              "installed",
              "enabled",
              "disabled"
            ],
            "example": "enabled",
            "type": "string"
          },
          "throttled": {
            "description": "`true`は速度制限中（無制限プランの高速容量を超過）。",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TestModeStatus": {
        "properties": {
          "data": {
            "properties": {
              "base_url_testing": {
                "description": "テストモード用ホストです。tke_test_またはtke_member_test_キーのみ使用できます。本番ホストへの呼び出しは403 partner.wrong_hostになります。",
                "type": "string"
              },
              "capabilities": {
                "properties": {
                  "bulk_orders": {
                    "type": "boolean"
                  },
                  "cancel_refund": {
                    "type": "boolean"
                  },
                  "refund_requests": {
                    "type": "boolean"
                  },
                  "webhooks": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "checklist": {
                "description": "同じ所有者のテストモードAPI実績から連携状況を判定します。Webhookの項目は組織のみに適用されます。",
                "items": {
                  "properties": {
                    "done": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": "string"
                    },
                    "last_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "step": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "drift": {
                "description": "模擬使用量ループの有効状態、間隔、最終実行時刻です。しきい値Webhookは対応する組織のみに送信されます。",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "interval_secs": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "last_run_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "mode": {
                "enum": [
                  "test",
                  "live"
                ],
                "type": "string"
              },
              "ready": {
                "description": "キー所有者が対応するチェック項目をすべて完了したかを示します。メンバーはWebhookテスト不要です。",
                "type": "boolean"
              },
              "sample_counts": {
                "properties": {
                  "test_esims": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "test_orders": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "seeded": {
                "description": "キー所有者にサンプルのテスト注文とeSIMがあるかを示します。",
                "type": "boolean"
              },
              "test_key_count": {
                "format": "int64",
                "type": "integer"
              },
              "wallet_balance": {
                "description": "キー所有者の仮想VNDテスト残高です。本番ウォレットとは分離されています。",
                "format": "int64",
                "type": "integer"
              },
              "webhook": {
                "properties": {
                  "endpoint_url": {
                    "nullable": true,
                    "type": "string"
                  },
                  "fail_next": {
                    "type": "integer"
                  },
                  "status": {
                    "nullable": true,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "TestModeWebhookFireRequest": {
        "properties": {
          "data": {
            "description": "サンプルペイロードの`data`フィールドを部分的に上書きします。",
            "type": "object"
          },
          "event_type": {
            "description": "テスト送信するWebhookイベントの種類。",
            "enum": [
              "order.completed",
              "order.failed",
              "esim.delivered",
              "esim.activated",
              "esim.usage_threshold",
              "esim.expiring",
              "wallet.low_balance",
              "catalog.updated"
            ],
            "type": "string"
          }
        },
        "required": [
          "event_type"
        ],
        "type": "object"
      },
      "Usage": {
        "description": "eSIMのデータ利用統計。未取得の場合は`updated_at = null`。",
        "nullable": true,
        "properties": {
          "expires_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "remaining_bytes": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "source": {
            "enum": [
              "poll",
              "webhook"
            ],
            "nullable": true,
            "type": "string"
          },
          "total_bytes": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "used_bytes": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WalletBalance": {
        "properties": {
          "data": {
            "properties": {
              "available": {
                "$ref": "#/components/schemas/Money"
              },
              "balance": {
                "$ref": "#/components/schemas/Money"
              },
              "credit_limit": {
                "$ref": "#/components/schemas/Money"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "WebhookConfig": {
        "properties": {
          "data": {
            "properties": {
              "active": {
                "description": "`false`は新規イベント停止を表し、画面からの一時停止かAPIキー失効時に同じトランザクションで停止します。CHECK_HEALTHに合格した`PUT /v1/webhooks/{id}`で再開します。",
                "type": "boolean"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "events": {
                "description": "空の場合はすべて受信します。",
                "items": {
                  "enum": [
                    "order.completed",
                    "order.failed",
                    "esim.delivered",
                    "esim.activated",
                    "esim.usage_threshold",
                    "esim.expiring",
                    "wallet.low_balance",
                    "catalog.updated"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "id": {
                "description": "`/v1/webhooks/{id}`に指定するエンドポイントIDです。作成ごとに新規発行され、削除後の再作成は元の復活ではなく別エンドポイントになります。",
                "format": "uuid",
                "type": "string"
              },
              "last_delivery_at": {
                "description": "このエンドポイントで最後に送信した時刻です。`null`は送信失敗ではなく未送信であり、パートナーがWebhook未受信を報告した際に最初に確認します。",
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "secret_last4": {
                "description": "Webhookシークレットの末尾4文字です。秘密全体を再公開せず、手元の鍵が署名に使われるものか確認できます。全体は作成時に1回だけ表示します。",
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "WebhookEndpoint": {
        "properties": {
          "active": {
            "description": "`false`は新規イベント停止を表し、画面からの一時停止かAPIキー失効時に同じトランザクションで停止します。CHECK_HEALTHに合格した`PUT /v1/webhooks/{id}`で再開します。",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "description": "空の場合はすべて受信します。",
            "items": {
              "enum": [
                "order.completed",
                "order.failed",
                "esim.delivered",
                "esim.activated",
                "esim.usage_threshold",
                "esim.expiring",
                "wallet.low_balance",
                "catalog.updated"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "description": "`/v1/webhooks/{id}`に指定するエンドポイントIDです。作成ごとに新規発行され、削除後の再作成は元の復活ではなく別エンドポイントになります。",
            "format": "uuid",
            "type": "string"
          },
          "last_delivery_at": {
            "description": "このエンドポイントで最後に送信した時刻です。`null`は送信失敗ではなく未送信であり、パートナーがWebhook未受信を報告した際に最初に確認します。",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "secret_last4": {
            "description": "Webhookシークレットの末尾4文字です。秘密全体を再公開せず、手元の鍵が署名に使われるものか確認できます。全体は作成時に1回だけ表示します。",
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookListResponse": {
        "properties": {
          "data": {
            "properties": {
              "items": {
                "items": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "type": "array"
              },
              "mode": {
                "$ref": "#/components/schemas/ModeEcho"
              },
              "next_cursor": {
                "description": "次のページを取得する際は値をそのまま返してください。終了の唯一の合図は`null`です。`page_size`より少ない件数でも続きがある場合があります。",
                "nullable": true,
                "type": "string"
              },
              "page_size": {
                "description": "サーバーがページに使用した、上限適用後の最大件数です。`items`の実際の要素数ではありません。",
                "nullable": true,
                "type": "integer"
              },
              "total": {
                "description": "条件に一致する件数です。集計コストが高い場合は`null`になります。終端の判定には使用せず、`next_cursor`を確認してください。",
                "format": "int64",
                "nullable": true,
                "type": "integer"
              },
              "warnings": {
                "description": "一覧の理由。特記事項がなければ空です。固定コード：`filtered_by_key_package_filters`、`filtered_by_provider_scope`、`no_price_for_org`、`price_filter_removed_rows`、`provider_disabled`、`capability_missing`。それぞれキー制限、組織の供給元範囲、価格未設定、価格条件、供給元無効、機能未宣言を示します。`count`は対象行数、数値化できない場合は`null`です。",
                "example": [],
                "items": {
                  "$ref": "#/components/schemas/ListWarning"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "ok": {
            "enum": [
              true
            ],
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "data"
        ],
        "type": "object"
      },
      "WebhookRequest": {
        "properties": {
          "events": {
            "description": "空の場合はすべて受信。不明な値は400 `internal.validation_failed`（項目`events`）。",
            "items": {
              "enum": [
                "order.completed",
                "order.failed",
                "esim.delivered",
                "esim.activated",
                "esim.usage_threshold",
                "esim.expiring",
                "wallet.low_balance",
                "catalog.updated"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "example": "https://partner.example.com/hooks/tke",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "TkeHmac": {
        "description": "HMAC-SHA256認証（§4）。`X-TKE-Key`（公開key_id）、`X-TKE-Timestamp`（エポックミリ秒）、`X-TKE-Nonce`（リクエストごとのUUID）、`X-TKE-Signature`（小文字16進数）の4ヘッダーを送信します。signing_string = method\npath\ntimestamp\nnonce\nbody_hash、body_hash = SHA256(raw_body)の16進数です。定数時間で比較します。pathにはクエリ文字列を含みます。",
        "in": "header",
        "name": "X-TKE-Signature",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "eSIM販売を連携するパートナー向けOpen APIです（パートナー階層は1段）。全`/v1/*`エンドポイントで4つの`X-TKE-*`ヘッダーによる**HMAC-SHA256**認証が必須で、未署名モードはありません。金銭・注文関連のPOSTは`Idempotency-Key`が必要です。`tke_test_`キーはテストホストで仮想ウォレット・在庫・発行を利用します。RESTを正とし、`updated_since`とカーソルで照合します。Webhookは補助です。主キーは常に`id`、外部キーは`order_id`などの接頭辞を持ちます。",
    "title": "Tổng Kho eSIM — Open API đối tác",
    "version": "2.4.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/v1/catalog/packages": {
      "get": {
        "description": "必要な権限スコープ: `catalog:read`.\n\n組織向けプランカタログです。2つの供給システムを共通化し、`?market=`で絞り込みます。\n\n実際に購入できるプランのみを返します。公開済み、供給元が販売中、キーの制限内、組織向け価格設定済みのすべてが必要です。価格未設定のプランは注文できないため表示しません。\n\nカーソル方式：初回は`cursor`なしで呼び、以後`next_cursor`をそのまま渡し、`null`まで繰り返します。`page_size`未満でも終端ではありません。\n\n`capabilities`は実際の宣言のみを反映し、推測しません。未宣言は全フラグ`false`です。確実に`422`となる機能を約束するより、利用可能なボタンの一部を省く方を選びます。\n\nカタログには数量や在庫あり・なしなどの在庫概念がありません。供給元が対応できない注文は、`POST /v1/orders`で`esim.out_of_stock`などの明確なエラーを返すため、事前のフィールドから推測する必要はありません。",
        "operationId": "get_catalog_packages",
        "parameters": [
          {
            "description": "1ページの件数です。既定50、上限100。上限を超えてもエラーにせず100に制限します。",
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "供給システムは`domestic` | `international`です。一覧にない値は全カタログではなく`internal.invalid_filter`（400）を返し、誤記が無制限の絞り込みと誤認されないようにします。",
            "in": "query",
            "name": "market",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO-3166 alpha-2の国コード（例：`VN`）。この国を対象とするプランのみ。",
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "地域スラッグ（例：`chau-a`）。その地域の国を1つ以上含むプランと、すべてのグローバルプランが対象です。",
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "公開コードとプラン名を自由検索します（部分一致、大文字小文字を区別しません）。",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1つの商品タグで絞り込みます。保存時と同様に余分な空白を除き、小文字とハイフンで正規化するため、`Ban Le`と`ban-le`は同じタグです。",
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "データ形式：`daily` | `fixed` | `unlimited`。旧`supports_topup`を置き換えます。不明な値は`internal.invalid_filter`（400）。",
            "in": "query",
            "name": "data_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "最低データ容量（**バイト**）です。日次プランは1日分の容量で比較し、無制限プランは下限条件を常に満たします。",
            "in": "query",
            "name": "data_min_bytes",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "最大データ容量（**バイト**）です。無制限プランは除外されます。無制限に上限は適用できず、含めると最小容量を探す利用者に無制限プランが表示されてしまうためです。",
            "in": "query",
            "name": "data_max_bytes",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "最低有効日数です。",
            "in": "query",
            "name": "days_min",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "最大有効日数です。",
            "in": "query",
            "name": "days_max",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "組織向け価格と比較する最低価格（VND）です。サーバーでページ分割した後に適用されるため、件数が少なくても終端とは限りません。",
            "in": "query",
            "name": "price_min",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "最高価格（VND）です。`price_min`と同じ規則に従います。",
            "in": "query",
            "name": "price_max",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "指定した通信世代（`2g` | `3g` | `4g` | `5g`）の対応プランのみ。不明な値は`internal.invalid_filter`（400）です。",
            "in": "query",
            "name": "network_gen",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`true`はWi-Fi共有対応の宣言あり、`false`は非対応の宣言あり。未宣言（`features.hotspot = null`）はどちらにも一致しません。文字列`true`/`false`のみ許可します。",
            "in": "query",
            "name": "hotspot",
            "required": false,
            "schema": {
              "enum": [
                "true",
                "false"
              ],
              "type": "string"
            }
          },
          {
            "description": "少なくとも1つのOSでこのアプリに対応すると宣言したプランのみを取得します（`app=tiktok`）。未宣言は一致せず、情報がないことは保証ではありません。現在`tiktok`のみ有効で、ほかのコードは`internal.invalid_filter`（400）です。",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`true`は音声対応の宣言あり、`false`は非対応の宣言あり。未宣言はどちらにも一致しません。文字列`true`/`false`のみ許可します。",
            "in": "query",
            "name": "voice",
            "required": false,
            "schema": {
              "enum": [
                "true",
                "false"
              ],
              "type": "string"
            }
          },
          {
            "description": "`next_cursor`をそのまま返してください。**短いページでも終了せず、`null`でのみ終了します。** キー制限、組織価格、価格条件はページ分割後に適用されます。カーソルには条件の指紋が含まれ、条件変更や破損時は`catalog.cursor_mismatch`（400）となり、異なる検索結果の混在を防ぎます。",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackageListResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.invalid_filter`, `catalog.cursor_mismatch`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "プラン一覧を取得",
        "tags": [
          "catalog"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/catalog/packages/{code}": {
      "get": {
        "description": "必要な権限スコープ: `catalog:read`.\n\n公開コードで1つのプラン詳細を取得します。`data`は`GET /v1/catalog/packages`の項目と同じフィールドに`mode`を加えたものです。詳細専用フィールドはなく、`Package`型は1つで対応できます。\n\n参照できないコードは、コード不存在、キー制限外、組織価格なし、供給元との紐付け消失のすべてで`partner.package_not_visible`（404）です。理由を区別すると、第三者による全カタログの列挙を許すためです。",
        "operationId": "get_catalog_packages__code_",
        "parameters": [
          {
            "description": "カタログの`code`（`public_sku`）に当たるプランコードです。供給元を切り替えても不変で、照合キーとして保存できます。キー制限外や組織価格未設定のコードも、不存在と同じ`404 partner.package_not_visible`です。",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackageDetail"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.package_not_visible`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "プランを1件取得",
        "tags": [
          "catalog"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/esims": {
      "get": {
        "description": "必要な権限スコープ: `esims:read`.",
        "operationId": "get_esims",
        "parameters": [
          {
            "description": "1ページの件数です。既定50、上限200。上限を超えてもエラーにせず200に制限します。",
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "`esim_status`で絞り込みます。一覧にない値は空配列ではなく`internal.invalid_filter`（400）を返します。`cancelled`の`l`を1つ省いた`canceled`などの誤記を、該当するeSIMがないと誤認するのを防ぎます。",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "available",
                "reserved",
                "sold",
                "delivered",
                "in_use",
                "used_up",
                "expired",
                "suspended",
                "cancelled",
                "provider_failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "1つの注文に属するeSIMのみ。",
            "in": "query",
            "name": "order_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "ICCIDで絞り込みます（文字列、完全一致）。",
            "in": "query",
            "name": "iccid",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "注文時の`external_ref`が完全一致する注文のすべてのeSIM。",
            "in": "query",
            "name": "external_ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO-8601 UTC形式です。`updated_at >= updated_since`の全レコードを昇順で返す、標準の取得型照合（§8.5）です。Webhookを取り逃しても状態から復元できます。形式不正は`internal.invalid_filter`（400）です。",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "次ページには`next_cursor`をそのまま渡します。不正なカーソルはエラーにならず先頭から読み直します。これは形式変更時の互換性維持のためです。先頭ページで無限ループしないよう、返されたカーソルが送信値と異なることを確認してください。",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "追加ブロックをカンマ区切りで指定します。`lpa`は`install`、`qr`は詳細取得時のみ`install.qr_code_base64`を返します。**コードの返却は開示**であり、対象の全eSIMを永続的に取消不可にします（`cancellable.allowed = false`、`reason = code_disclosed`）。顧客へすぐ渡す場合に要求し、後日渡す場合は省略して取消権を保ってください。不明な値は`internal.invalid_filter`（400、`field: \"include\"`）。",
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "example": "lpa",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EsimListResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.invalid_filter`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "eSIM一覧を取得（取得型照合）",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/esims/{id}": {
      "get": {
        "description": "必要な権限スコープ: `esims:read`.",
        "operationId": "get_esims__id_",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "追加ブロックをカンマ区切りで指定します。`lpa`は`install`、`qr`は詳細取得時のみ`install.qr_code_base64`を返します。**コードの返却は開示**であり、対象の全eSIMを永続的に取消不可にします（`cancellable.allowed = false`、`reason = code_disclosed`）。顧客へすぐ渡す場合に要求し、後日渡す場合は省略して取消権を保ってください。不明な値は`internal.invalid_filter`（400、`field: \"include\"`）。",
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "example": "lpa",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Esim"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.invalid_filter`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "eSIMを1件取得",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/esims/{id}/cancel": {
      "post": {
        "description": "必要な権限スコープ: `esims:write`.",
        "operationId": "post_esims__id__cancel",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "クライアントが生成する文字列。同じキーと本文は1回だけ実行され、再試行は元の結果を返します。`api_key_id`単位（§11）なので、異なるキーは別の命令です。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `esim.not_cancellable`, `idempotency.conflict`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `capability.not_supported`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "未使用のeSIMを取り消す",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/esims/{id}/change-plan": {
      "post": {
        "description": "必要な権限スコープ: `esims:write`.",
        "operationId": "post_esims__id__change-plan",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "クライアントが生成する文字列。同じキーと本文は1回だけ実行され、再試行は元の結果を返します。`api_key_id`単位（§11）なので、異なるキーは別の命令です。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangePlanResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `wallet.insufficient_balance`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.package_not_visible`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `esim.topup_not_supported`, `esim.topup_provider_mismatch`, `esim.not_eligible`, `idempotency.conflict`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `capability.not_supported`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "eSIMを追加チャージする",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/esims/{id}/plan-options": {
      "get": {
        "description": "必要な権限スコープ: `esims:read`.\n\nこのeSIMに有効な追加プランのみを返します。サーバーが`id`から供給元を調べ、その供給元のプランだけを抽出します。`/v1`では`provider_id`を公開しないため、サーバー側で異なる供給元のプラン選択を構造的に防止します。一覧にないコードで`POST /v1/esims/{id}/change-plan`を呼ぶと`409 esim.topup_provider_mismatch`です。\n\n供給元が未登録のeSIM（単純インポートや元データ未取得）では、空一覧（`total: 0`）が正しい応答で、エラーではありません。",
        "operationId": "get_esims__id__plan-options",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1ページの件数です。既定50、上限200。上限を超えてもエラーにせず200に制限します。",
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "次ページには`next_cursor`をそのまま渡します。不正なカーソルはエラーにならず先頭から読み直します。これは形式変更時の互換性維持のためです。先頭ページで無限ループしないよう、返されたカーソルが送信値と異なることを確認してください。",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanOptionsResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "このeSIM用の有効な追加チャージプラン",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/esims/{id}/refund-requests": {
      "get": {
        "description": "必要な権限スコープ: `esims:read`.\n\n承認済みの本番メンバーキー専用です。所有eSIMの直近50件までの返金申請を新しい順に返し、next_cursorとtotalはnullです。has_open_requestは審査待ちを示します。組織・テストキーはcapability.not_supportedです。",
        "operationId": "get_esims__id__refund-requests",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberRefundRequestListResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `capability.not_supported`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "eSIM返金申請履歴（会員専用）",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live"
        ],
        "x-tke-owner-types": [
          "member"
        ]
      },
      "post": {
        "description": "必要な権限スコープ: `esims:write`.\n\n承認済みの本番メンバーキー専用です。Idempotency-Keyを付けて所有eSIMの返金を申請し、管理者承認前に残高は移動しません。組織・テストキーはcapability.not_supportedです。テストモードではeSIMキャンセルで仮想残高への返金を確認します。",
        "operationId": "post_esims__id__refund-requests",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "クライアントが生成する文字列。同じキーと本文は1回だけ実行され、再試行は元の結果を返します。`api_key_id`単位（§11）なので、異なるキーは別の命令です。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberRefundRequestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberRefundRequestResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `esim.refund_not_eligible`, `esim.refund_request_pending`, `idempotency.conflict`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `capability.not_supported`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "eSIM返金申請を作成（会員専用）",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live"
        ],
        "x-tke-owner-types": [
          "member"
        ]
      }
    },
    "/v1/esims/{id}/usage": {
      "get": {
        "description": "必要な権限スコープ: `esims:read`.\n\neSIM の使用済み・残りデータ量を、値の基準時刻 `updated_at`（実際の鮮度）とともに返します。リクエスト時のみ照会する提供元（現在は SkyFi）の eSIM では、この呼び出しがスキャンをキューに入れ、結果を最大約 15 秒待つため、応答に最大 ~15 秒かかることがあり、返す値は完了したばかりのスキャンのものです。スキャンの失敗、同一 eSIM の 15 秒間隔制限内、または待機タイムアウトの場合はエラーを返さず、最後に保存された値を返すので `updated_at` を確認してください。他の提供元は定期的に更新される保存値を返します。",
        "operationId": "get_esims__id__usage",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EsimUsage"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `capability.not_supported`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "使用済みデータ",
        "tags": [
          "esims"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/orders": {
      "get": {
        "description": "必要な権限スコープ: `orders:read`.",
        "operationId": "get_orders",
        "parameters": [
          {
            "description": "1ページの件数です。既定50、上限200。上限を超えてもエラーにせず200に制限します。",
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "注文状態で絞り込みます。一覧にない値は`internal.invalid_filter`（400）を返します。",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "completed",
                "pending_provider",
                "provider_failed",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "description": "注文確定時に送信した参照コードで絞り込みます（完全一致）。",
            "in": "query",
            "name": "external_ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO-8601 UTC形式です。`updated_at >= updated_since`の全レコードを昇順で返す、標準の取得型照合（§8.5）です。Webhookを取り逃しても状態から復元できます。形式不正は`internal.invalid_filter`（400）です。",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "次ページには`next_cursor`をそのまま渡します。不正なカーソルはエラーにならず先頭から読み直します。これは形式変更時の互換性維持のためです。先頭ページで無限ループしないよう、返されたカーソルが送信値と異なることを確認してください。",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderListResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.invalid_filter`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "注文一覧を取得（取得型照合）",
        "tags": [
          "orders"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      },
      "post": {
        "description": "必要な権限スコープ: `orders:write`.",
        "operationId": "post_orders",
        "parameters": [
          {
            "description": "クライアントが生成する文字列。同じキーと本文は1回だけ実行され、再試行は元の結果を返します。`api_key_id`単位（§11）なので、異なるキーは別の命令です。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            },
            "description": "24時間以内に同じ`Idempotency-Key`と本文で再実行すると、同一の本文を返し、再課金せず、`Idempotent-Replayed: true`を付けます。新規確定は`201`です。成功をこのステータスだけで判定しないでください。"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.invalid_filter`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `wallet.insufficient_balance`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.package_not_visible`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `esim.out_of_stock`, `idempotency.conflict`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `invoice.buyer_invalid`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "注文を作成する（直接購入）",
        "tags": [
          "orders"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/orders/bulk": {
      "post": {
        "description": "必要な権限スコープ: `orders:write`.\n\n複数行を一括注文します。各行は`POST /v1/orders`と同じquote→commitを実行し、独立した1注文を作成します。\n\n部分成功方式で、失敗行は他行を止めず、成功行だけを課金します。在庫切れ、残高不足、販売不可、乱用対策の制限などは`lines[].error`に入り、バッチ全体のHTTP状態は変えません。途中で残高不足になっても、安価な行は購入できるため後続行を試します。\n\n状態は常に`200`です。単一の新規リソースではなく行別の混合結果のため`201`ではなく、リクエスト内で完了するので`202`やポーリングもありません。\n\n同じ`Idempotency-Key`と同じ本文で再実行すると既存バッチを読み、完了行の結果をそのまま返し、`pending`行だけを続行します。二重課金はありません。実行行がなければ`Idempotent-Replayed: true`です。同じキーで本文が異なると`idempotency.conflict`です。\n\n同じ組織の同内容バッチを10分以内に再送すると、キーが異なっても誤クリックの重複と見なし、旧バッチを`Idempotent-Replayed: true`付きで返して追加課金しません。本当に同じ商品を追加購入する場合は、署名対象本文の`external_ref`を変更してください。バッチの区別と後日の照合にも使えます。全行が失敗して注文未作成のバッチは制限せず、10分後は通常どおり再注文できます。\n\n行の参照は`lines[].external_ref`、バッチ参照は応答上部にそのまま返します。\n\n応答にLPA/QRは含まず、各`order_id`で`GET /v1/orders/{order_id}`から取得します。",
        "operationId": "post_orders_bulk",
        "parameters": [
          {
            "description": "クライアントが生成する文字列。同じキーと本文は1回だけ実行され、再試行は元の結果を返します。`api_key_id`単位（§11）なので、異なるキーは別の命令です。",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkBatchResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.package_not_visible`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `idempotency.conflict`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.limit_exceeded`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "複数行を一括注文（1行につき1注文）",
        "tags": [
          "orders"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/orders/bulk/{id}": {
      "get": {
        "description": "必要な権限スコープ: `orders:read`.\n\n送信済み一括注文の行別結果を再取得します。最初の応答を失っても本文を再送せず復旧できます。別組織・別環境（本番／テスト）のバッチは`404`です。",
        "operationId": "get_orders_bulk__id_",
        "parameters": [
          {
            "description": "POST /v1/orders/bulkが返すバッチID（UUID）です。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkBatchResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "一括注文の結果",
        "tags": [
          "orders"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/orders/{id}": {
      "get": {
        "description": "必要な権限スコープ: `orders:read`.",
        "operationId": "get_orders__id_",
        "parameters": [
          {
            "description": "注文ID（UUID）。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "追加ブロックをカンマ区切りで指定します。`lpa`は`install`、`qr`は詳細取得時のみ`install.qr_code_base64`を返します。**コードの返却は開示**であり、対象の全eSIMを永続的に取消不可にします（`cancellable.allowed = false`、`reason = code_disclosed`）。顧客へすぐ渡す場合に要求し、後日渡す場合は省略して取消権を保ってください。不明な値は`internal.invalid_filter`（400、`field: \"include\"`）。",
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "example": "lpa",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.invalid_filter`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "注文詳細とeSIM",
        "tags": [
          "orders"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/orders/{id}/resend": {
      "post": {
        "description": "必要な権限スコープ: `orders:write`.",
        "operationId": "post_orders__id__resend",
        "parameters": [
          {
            "description": "注文ID（UUID）。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResendResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `order.not_deliverable`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "注文のメール・QRを再送",
        "tags": [
          "orders"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/testmode/esims/{id}/simulate": {
      "post": {
        "description": "必要な権限スコープ: `esims:write`.\n\ntke_test_またはtke_member_test_テストキー専用です。所有者のテストeSIMに使用量、インストール状態、期限切れ、速度制限、次回操作の供給元拒否を設定します。本文には少なくとも1項目が必要で、空の場合は422 testmode.invalid_scenarioです。本番と同じGET /v1/esims/{id}と/usageで結果を確認できます。プラン変更とキャンセル規則は共通で、実際の供給元は呼び出しません。",
        "operationId": "post_testmode_esims__id__simulate",
        "parameters": [
          {
            "description": "販売済みeSIMの固定ID。再利用され得るICCIDとは異なります。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestModeSimulateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestModeEsimState"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`, `testmode.live_key_forbidden`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `testmode.invalid_scenario`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "テストeSIMのライフサイクルをシミュレーション（テストキー専用）",
        "tags": [
          "testmode"
        ],
        "x-tke-modes": [
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/testmode/reset": {
      "post": {
        "description": "必要な権限スコープ: `orders:write`.",
        "operationId": "post_testmode_reset",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestModeResetInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestModeReset"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`, `testmode.live_key_forbidden`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "テストデータをリセット（テストキー専用）",
        "tags": [
          "testmode"
        ],
        "x-tke-idempotency-owner-types": [
          "member"
        ],
        "x-tke-modes": [
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ],
        "x-tke-required-body-owner-types": [
          "member"
        ]
      }
    },
    "/v1/testmode/seed": {
      "post": {
        "description": "必要な権限スコープ: `orders:write`.",
        "operationId": "post_testmode_seed",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestModeSeed"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`, `testmode.live_key_forbidden`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `testmode.no_sellable_package`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "テストモードのサンプルデータを作成（テストキー専用）",
        "tags": [
          "testmode"
        ],
        "x-tke-idempotency-owner-types": [
          "member"
        ],
        "x-tke-modes": [
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/testmode/status": {
      "get": {
        "description": "必要な権限スコープ: `esims:read`.",
        "operationId": "get_testmode_status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestModeStatus"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`, `testmode.live_key_forbidden`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "テストモード概要（テストキー専用）",
        "tags": [
          "testmode"
        ],
        "x-tke-modes": [
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/testmode/webhooks/fail-next": {
      "post": {
        "description": "必要な権限スコープ: `webhook:manage`.",
        "operationId": "post_testmode_webhooks_fail-next",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestModeFailNextRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestModeFailNextResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`, `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`, `testmode.live_key_forbidden`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "次のWebhook失敗をシミュレーション（テストキー専用）",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/testmode/webhooks/fire": {
      "post": {
        "description": "必要な権限スコープ: `webhook:manage`.",
        "operationId": "post_testmode_webhooks_fire",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestModeWebhookFireRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`, `testmode.live_key_forbidden`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.not_configured`, `internal.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "テストWebhookイベントを送信（テストキー専用）",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/wallet/balance": {
      "get": {
        "description": "必要な権限スコープ: `wallet:read`.",
        "operationId": "get_wallet_balance",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletBalance"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "ウォレット残高",
        "tags": [
          "wallet"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization",
          "member"
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "description": "必要な権限スコープ: `webhook:manage`.\n\n呼出し元APIキーのエンドポイントのみです。同じ組織内の別キーでも相互に参照できません（§5.11：`api_key_id`に紐付き、本番とテストは共有しません）。\n\n未設定なら`404`ではなく空配列の`200`です。コレクションは常に存在し、項目だけがない状態です。",
        "operationId": "get_webhooks",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookListResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhookエンドポイント一覧を取得",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      },
      "post": {
        "description": "必要な権限スコープ: `webhook:manage`.\n\n呼出し元キーのWebhookエンドポイントを作成します。保存前にURLへ署名済み`ping`をPOSTします（CHECK_HEALTH）。2xxでなければ保存せず`422 webhook.health_check_failed`です。公開`https`URLが必須で、内部・メタデータIPは`422 webhook.url_not_allowed`です。\n\n`webhook_secret`は作成時に1回だけ表示し、再取得できません。紛失時はダッシュボードでローテーションしてください。旧シークレットも24時間有効です（§8.4）。\n\n既存エンドポイントがあれば、一時停止（`is_active: false`）中でも`409 webhook.already_configured`です。停止中もURL・秘密鍵・ログは保持されます。作り直す場合は`DELETE /v1/webhooks/{id}`の後に新規作成します。",
        "operationId": "post_webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWebhookResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.already_configured`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.health_check_failed`, `webhook.url_not_allowed`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhookエンドポイントを作成する",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/webhooks/deliveries": {
      "get": {
        "description": "必要な権限スコープ: `webhook:manage`.",
        "operationId": "get_webhooks_deliveries",
        "parameters": [
          {
            "description": "1始まりのページ番号。末尾を超えると`items: []`と実際の`total`を返します（200、404ではありません）。",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "1ページの件数です。既定50、上限200。上限を超えてもエラーにせず200に制限します。",
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "イベント種別で絞り込みます（Webhookイベント一覧を参照）。",
            "in": "query",
            "name": "event_type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "送信状態で絞り込みます。`?status=failed`は取得型のWebhook照合（§13）で使用します。不明な値はエラーにならず無視され、すべてのログが返されます。",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "delivered",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "1つのイベントの全配信試行（再配信を含む）。",
            "in": "query",
            "name": "event_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryListResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.not_configured`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhook配信ログ",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/webhooks/deliveries/{id}/replay": {
      "post": {
        "description": "必要な権限スコープ: `webhook:manage`.",
        "operationId": "post_webhooks_deliveries__id__replay",
        "parameters": [
          {
            "description": "Webhook送信1件のIDです（`GET /v1/webhooks/deliveries`の`items[].id`）。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryReplayResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.delivery_not_found`, `webhook.not_configured`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhookを再送",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "description": "必要な権限スコープ: `webhook:manage`.\n\n削除すると呼出し元キーの新規イベント受信が止まります。\n\n`webhook_secret`も失われます。`POST /v1/webhooks`で再作成すると新しい`id`とシークレットになるため、検証関数を更新してください。秘密鍵を保ったまま一時停止する場合は、ダッシュボードの停止ボタンを使用します。\n\n送信ログは照合用にすべて保持しますが、削除済みエンドポイントの送信は再実行できません。\n\n再試行待ちの`pending`送信は`endpoint_disabled`で停止し、ログに残ります（§8.5）。\n\n別キーの`id`や削除済みの`id`は、成功の200ではなく`404 webhook.not_found`です。",
        "operationId": "delete_webhooks__id_",
        "parameters": [
          {
            "description": "WebhookエンドポイントID（`POST /v1/webhooks`または`GET /v1/webhooks`の`id`）。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteWebhookResponse"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhookエンドポイントを削除（新規イベントの受信停止）",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      },
      "get": {
        "description": "必要な権限スコープ: `webhook:manage`.",
        "operationId": "get_webhooks__id_",
        "parameters": [
          {
            "description": "WebhookエンドポイントID（`POST /v1/webhooks`または`GET /v1/webhooks`の`id`）。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookConfig"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.not_found`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhookエンドポイントを1件取得",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      },
      "put": {
        "description": "必要な権限スコープ: `webhook:manage`.",
        "operationId": "put_webhooks__id_",
        "parameters": [
          {
            "description": "WebhookエンドポイントID（`POST /v1/webhooks`または`GET /v1/webhooks`の`id`）。",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookConfig"
                }
              }
            },
            "description": "成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `internal.validation_failed`"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.invalid_key`, `partner.invalid_signature`, `partner.timestamp_expired`, `partner.nonce_reused`"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.ip_not_allowed`, `partner.scope_denied`, `partner.key_suspended`, `partner.key_revoked`, `org.suspended`"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.not_found`"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `webhook.health_check_failed`, `webhook.url_not_allowed`"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.rate_limited`"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "エラー: `partner.endpoint_disabled`, `internal.service_unavailable`"
          }
        },
        "summary": "Webhookエンドポイントを更新する",
        "tags": [
          "webhook"
        ],
        "x-tke-modes": [
          "live",
          "test"
        ],
        "x-tke-owner-types": [
          "organization"
        ]
      }
    }
  },
  "security": [
    {
      "TkeHmac": []
    }
  ],
  "servers": [
    {
      "description": "Live",
      "url": "https://api.tongkhoesim.com"
    },
    {
      "description": "テストモード",
      "url": "https://api-testing.tongkhoesim.com"
    }
  ],
  "tags": [
    {
      "description": "2つの供給システムを共通化したプランカタログです。システムは別パスではなく、`market`フィールド（`domestic` | `international`）と`?market=`フィルターで区別します。\n\n数量や`available`／`low`／`out_of_stock`などの在庫概念はありません。プランを表示し、供給できない注文は`POST /v1/orders`で`esim.out_of_stock`などを明確に返します。カタログでの事前告知はありません。\n\n共通のカーソル方式です。`total`は集計が軽い場合（国内システムへの絞り込み）のみで、それ以外は`null`です。",
      "name": "catalog"
    },
    {
      "description": "注文と照合",
      "name": "orders"
    },
    {
      "description": "eSIM記録、利用量、追加チャージ、取り消し",
      "name": "esims"
    },
    {
      "description": "ウォレット残高",
      "name": "wallet"
    },
    {
      "description": "Webhook設定、配信ログ、シミュレーター",
      "name": "webhook"
    },
    {
      "description": "api-testingホストでtke_test_またはtke_member_test_のテストキーのみを使用します。本番残高や供給元を使わず、所有者のテストeSIMとデータを模擬します。メンバーのテストモードはWebhook、一括注文、審査用返金申請に対応していません。",
      "name": "testmode"
    }
  ]
}
