{"openapi":"3.0.3","info":{"title":"roguemobile API 文档（旧版兼容）","version":"0.28.0","description":"roguemobile 渠道接口，提供卡号及线路查询、套餐与地区目录、激活、续费、重新激活、订单、资金流水和结果回调。独立换套餐及加购暂未开放；停机、独立 WFC 与地址资格校验不在当前开放范围。USD 预存款，受理前按整批报价检查余额，处理前复查全部剩余金额；不冻结资金，逐卡成功才扣款。每单至少一张卡，异步办理，同渠道结果未明时后续收费任务排队。每渠道限 120 次请求/分钟；任务补查与恢复合计每订单限 1 次/30 秒。接入前请取得渠道凭证、已分配卡号和对应报价。\n\n時間輸出口徑：API 查詢及新建立的回呼統一使用美東時間（America/New_York），明確帶 -04:00（EDT）或 -05:00（EST）。上游已有時區偏移時優先按該偏移換算；已知上游套餐／帳戶時間未標偏移時，按已核對的 America/New_York 冬夏令時換算。上游純日期、缺失值、無效時間及夏令時切換時無法唯一確定的時刻保留原值，不補造時間。套餐週期只使用本次已核實身份的上游即時回包或對應歷史業務回執。當期與下期分別保留；未提供的日期為 null，不再估算到期日。已建立的舊回呼重試時保持原簽名正文；留存的上游原文及請求回顯保持原值。日期篩選仍使用各接口原有時區。"},"externalDocs":{"url":"https://rogue.gcsl.ai/docs/","description":"roguemobile API 文档"},"servers":[{"url":"/v1"}],"security":[{"ChannelKey":[]}],"components":{"securitySchemes":{"ChannelKey":{"type":"http","scheme":"bearer","description":"管理员分配的 rc_key_ 渠道 API Key"}},"schemas":{"Error":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"balance":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"required":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"currency":{"type":"string"}},"required":["code","message","request_id"]}},"required":["success","error"]},"Pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}},"required":["page","per_page","total","has_more"]},"Wallet":{"type":"object","properties":{"business_funds":{"type":"object","properties":{"enabled":{"type":"boolean"},"opened_at":{"type":"string"},"currency":{"type":"string"},"amount_unit":{"type":"string"},"total_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"classification_required":{"type":"boolean"},"accounts":{"type":"object","properties":{"physical":{"type":"object","properties":{"label":{"type":"string"},"opening_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"recharge":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"card_fees":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"package_fees":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"refunds":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"adjustments":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"unsettled_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"}},"required":["label","opening_balance","balance","recharge","card_fees","package_fees","refunds","adjustments","unsettled_amount"]},"esim":{"type":"object","properties":{"label":{"type":"string"},"opening_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"recharge":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"card_fees":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"package_fees":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"refunds":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"adjustments":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"unsettled_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"}},"required":["label","opening_balance","balance","recharge","card_fees","package_fees","refunds","adjustments","unsettled_amount"]},"unclassified":{"type":"object","properties":{"label":{"type":"string"},"opening_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"recharge":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"card_fees":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"package_fees":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"refunds":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"adjustments":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"unsettled_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"}},"required":["label","opening_balance","balance","recharge","card_fees","package_fees","refunds","adjustments","unsettled_amount"]}},"required":["physical","esim","unclassified"]}},"required":["enabled","opened_at","currency","amount_unit","total_balance","classification_required","accounts"]},"balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"available":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"unsettled_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"available_for_orders":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串","nullable":true},"currency":{"type":"string","enum":["USD"]}},"required":["balance","available","currency"]},"HuiWallet":{"type":"object","properties":{"snail_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"gcsl_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"currency":{"type":"string","enum":["USD"]}},"required":["snail_balance","gcsl_balance","currency"],"additionalProperties":false},"LedgerEntry":{"type":"object","properties":{"business_fund":{"type":"string","enum":["physical","esim","unclassified"]},"id":{"type":"string"},"kind":{"type":"string","enum":["recharge","debit","record","record_adjustment","card_fee_refund"]},"recorded_amount":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"仅记账的余额变动为负数，不代表实际收款；历史零变动记录使用 record_adjustment 追加调整。"},"reference":{"type":"string"},"change":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"本次变动，充值和卡费返还为正数，扣费为负数"},"balance_after":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"order_id":{"type":"string","nullable":true},"item_id":{"type":"string","nullable":true},"txid":{"type":"string","nullable":true},"iccid":{"type":"string","nullable":true},"operation":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"currency":{"type":"string","enum":["USD"]}},"required":["id","kind","reference","change","balance_after","order_id","item_id","txid","iccid","operation","created_at","currency"]},"LedgerSummary":{"type":"object","properties":{"total":{"type":"integer"},"recharge_count":{"type":"integer"},"consumption_count":{"type":"integer"},"opening_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"recharge":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"consumption":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"closing_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"current_balance":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"recorded_amount":{"type":"string","pattern":"^-?\\d+\\.\\d{2}$","example":"15.00","description":"期间仅记账变动合计，为负数；不计入实际消耗金额。"},"currency":{"type":"string","enum":["USD"]},"timezone":{"type":"string","enum":["America/New_York"]}},"required":["total","recharge_count","consumption_count","opening_balance","recharge","consumption","closing_balance","current_balance","currency","timezone"]},"Card":{"type":"object","properties":{"iccid":{"type":"string"},"sim_type":{"type":"string","nullable":true,"enum":["physical","esim",null],"description":"卡类型尚未确认时返回 null，不能据此判断为实体 SIM 或 eSIM。"},"status":{"type":"string","enum":["unassigned","free","used"],"description":"库存使用事实：未分配、未使用、已使用；不表示线路 Active/Inactive。线路状态和当期日期请实时查询综合接口。"},"mdn":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"plan_code":{"type":"string","nullable":true},"scheduled_plan_code":{"type":"string","nullable":true},"last_synced_at":{"type":"string","nullable":true},"service_address":{"type":"object","nullable":true},"catalog_entry_id":{"type":"string","nullable":true},"catalog_snapshot":{"type":"object","nullable":true},"service_period":{"type":"object","nullable":true,"enum":[null],"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。"},"latest_handling":{"$ref":"#/components/schemas/LatestHandling"},"next_service_period":{"type":"object","nullable":true,"enum":[null],"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。"},"expiry_info":{"$ref":"#/components/schemas/LocalInventoryExpiry"},"binding_status":{"type":"string","enum":["current","historical","unconfirmed"]},"pending_handling":{"type":"object","additionalProperties":false,"properties":{"count":{"type":"integer","minimum":0}},"required":["count"]},"allocated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["iccid","sim_type","status","mdn","enrollment_id","plan_code","scheduled_plan_code","last_synced_at","service_address","catalog_entry_id","catalog_snapshot"]},"ServiceAddress":{"type":"object","properties":{"address":{"type":"string","maxLength":200},"city":{"type":"string","maxLength":100},"state":{"type":"string","pattern":"^[A-Za-z]{2}$"},"zip":{"type":"string","pattern":"^\\d{5}$"}},"required":["address","city","state","zip"]},"ZipRegion":{"type":"object","properties":{"zip":{"type":"string","pattern":"^\\d{5}$"},"city":{"type":"string"},"state":{"type":"string","pattern":"^[A-Z]{2}$"},"state_name":{"type":"string"},"city_source":{"type":"string","enum":["activation_history","address_reference","verified_reference"]},"reference_cities":{"type":"array","items":{"type":"string"}},"location_note":{"type":"string"},"area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"通用展示及区号筛选字段：合并同城市同州的历史区号和已确认实开区号；两类记录均为空才回退地区参考。仅展示已确认实开区号时使用 city_issued_area_codes。"},"area_code_source":{"type":"string","enum":["city_activation_history","geographic_reference","none"],"readOnly":true},"city_issued_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"渠道下拉列表专用：同城市同州已确认的实开区号，不分套餐。按核实过的开卡记录归集，不混入未核实历史或地理参考；无记录为 []。并非实时库存，不能保证或指定区号。"},"city_issued_area_code_samples":{"type":"array","items":{"type":"object","properties":{"area_code":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"sample_count":{"type":"integer","minimum":1}},"required":["area_code","sample_count"]},"readOnly":true,"description":"城市各已确认实开区号的去重号码数量，报告与 API 同号码去重"},"city_issued_sample_count":{"type":"integer","minimum":0,"readOnly":true,"description":"城市已确认实开记录的去重号码数；同城多条响应重复返回，不可相加；与旧历史样本可重叠"},"city_issued_history_zips":{"type":"array","items":{"type":"string","pattern":"^\\d{5}$"},"readOnly":true,"description":"同城含已确认实开记录的邮编"},"city_issued_last_observed_on":{"type":"string","format":"date","nullable":true,"readOnly":true,"description":"城市已知的最近实开日期；缺少日期或记录为 null"},"city_issued_sources":{"type":"array","items":{"type":"string","enum":["rogue_activation_report","rogue_api"]},"readOnly":true,"description":"记录类别标识，仅用于资料追踪；无记录为 []，界面区号选择使用 city_issued_area_codes"},"issued_sample_count":{"type":"integer","minimum":0,"readOnly":true,"description":"本 ZIP 已确认实开记录的去重号码数"},"issued_last_observed_on":{"type":"string","format":"date","nullable":true,"readOnly":true},"city_historical_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"同城市、同州全部邮编原导入历史样本的区号，不分套餐。保留旧统计，来源可能混合；不代表全部记录均已核实"},"city_area_code_samples":{"type":"array","items":{"type":"object","properties":{"area_code":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"sample_count":{"type":"integer","minimum":1}},"required":["area_code","sample_count"]},"readOnly":true},"city_sample_count":{"type":"integer","minimum":0,"readOnly":true,"description":"城市全部邮编样本汇总，同城响应中重复返回，不可跨邮编相加"},"city_history_zips":{"type":"array","items":{"type":"string","pattern":"^\\d{5}$"},"readOnly":true,"description":"同城有历史样本的邮编"},"city_last_observed_on":{"type":"string","format":"date","nullable":true,"readOnly":true},"historical_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true},"area_code_samples":{"type":"array","items":{"type":"object","properties":{"area_code":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"sample_count":{"type":"integer","minimum":1}},"required":["area_code","sample_count"]}},"reference_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"独立保留的地理核验资料。展示及筛选使用area_codes，本字段不覆盖城市实开区号；空数组表示尚未补充"},"reference_sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]},"readOnly":true},"reference_checked_on":{"type":"string","format":"date","nullable":true,"readOnly":true},"reference_scope":{"type":"string","nullable":true,"readOnly":true},"sample_count":{"type":"integer","minimum":0},"history_status":{"type":"string","enum":["observed","no_samples"]},"last_observed_on":{"type":"string","format":"date","nullable":true},"area_code_guaranteed":{"type":"boolean","enum":[false],"readOnly":true},"notice":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["zip","city","state","state_name","city_source","reference_cities","location_note","area_codes","area_code_source","city_issued_area_codes","city_issued_area_code_samples","city_issued_sample_count","city_issued_history_zips","city_issued_last_observed_on","city_issued_sources","issued_sample_count","issued_last_observed_on","city_historical_area_codes","city_area_code_samples","city_sample_count","city_history_zips","city_last_observed_on","historical_area_codes","area_code_samples","reference_area_codes","reference_sources","reference_checked_on","reference_scope","sample_count","history_status","last_observed_on","area_code_guaranteed","notice","updated_at"]},"RegionalCatalog":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"string"},"plan_code":{"type":"string","nullable":true},"plan_name":{"type":"string"},"service_address":{"$ref":"#/components/schemas/ServiceAddress"},"zip_region":{"type":"object","properties":{"zip":{"type":"string","pattern":"^\\d{5}$"},"city":{"type":"string"},"state":{"type":"string","pattern":"^[A-Z]{2}$"},"state_name":{"type":"string"},"city_source":{"type":"string","enum":["activation_history","address_reference","verified_reference"]},"reference_cities":{"type":"array","items":{"type":"string"}},"location_note":{"type":"string"},"area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"通用展示及区号筛选字段：合并同城市同州的历史区号和已确认实开区号；两类记录均为空才回退地区参考。仅展示已确认实开区号时使用 city_issued_area_codes。"},"area_code_source":{"type":"string","enum":["city_activation_history","geographic_reference","none"],"readOnly":true},"city_issued_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"渠道下拉列表专用：同城市同州已确认的实开区号，不分套餐。按核实过的开卡记录归集，不混入未核实历史或地理参考；无记录为 []。并非实时库存，不能保证或指定区号。"},"city_issued_area_code_samples":{"type":"array","items":{"type":"object","properties":{"area_code":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"sample_count":{"type":"integer","minimum":1}},"required":["area_code","sample_count"]},"readOnly":true,"description":"城市各已确认实开区号的去重号码数量，报告与 API 同号码去重"},"city_issued_sample_count":{"type":"integer","minimum":0,"readOnly":true,"description":"城市已确认实开记录的去重号码数；同城多条响应重复返回，不可相加；与旧历史样本可重叠"},"city_issued_history_zips":{"type":"array","items":{"type":"string","pattern":"^\\d{5}$"},"readOnly":true,"description":"同城含已确认实开记录的邮编"},"city_issued_last_observed_on":{"type":"string","format":"date","nullable":true,"readOnly":true,"description":"城市已知的最近实开日期；缺少日期或记录为 null"},"city_issued_sources":{"type":"array","items":{"type":"string","enum":["rogue_activation_report","rogue_api"]},"readOnly":true,"description":"记录类别标识，仅用于资料追踪；无记录为 []，界面区号选择使用 city_issued_area_codes"},"issued_sample_count":{"type":"integer","minimum":0,"readOnly":true,"description":"本 ZIP 已确认实开记录的去重号码数"},"issued_last_observed_on":{"type":"string","format":"date","nullable":true,"readOnly":true},"city_historical_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"同城市、同州全部邮编原导入历史样本的区号，不分套餐。保留旧统计，来源可能混合；不代表全部记录均已核实"},"city_area_code_samples":{"type":"array","items":{"type":"object","properties":{"area_code":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"sample_count":{"type":"integer","minimum":1}},"required":["area_code","sample_count"]},"readOnly":true},"city_sample_count":{"type":"integer","minimum":0,"readOnly":true,"description":"城市全部邮编样本汇总，同城响应中重复返回，不可跨邮编相加"},"city_history_zips":{"type":"array","items":{"type":"string","pattern":"^\\d{5}$"},"readOnly":true,"description":"同城有历史样本的邮编"},"city_last_observed_on":{"type":"string","format":"date","nullable":true,"readOnly":true},"historical_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true},"area_code_samples":{"type":"array","items":{"type":"object","properties":{"area_code":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"sample_count":{"type":"integer","minimum":1}},"required":["area_code","sample_count"]}},"reference_area_codes":{"type":"array","items":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"},"readOnly":true,"description":"独立保留的地理核验资料。展示及筛选使用area_codes，本字段不覆盖城市实开区号；空数组表示尚未补充"},"reference_sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]},"readOnly":true},"reference_checked_on":{"type":"string","format":"date","nullable":true,"readOnly":true},"reference_scope":{"type":"string","nullable":true,"readOnly":true},"sample_count":{"type":"integer","minimum":0},"history_status":{"type":"string","enum":["observed","no_samples"]},"last_observed_on":{"type":"string","format":"date","nullable":true},"area_code_guaranteed":{"type":"boolean","enum":[false],"readOnly":true},"notice":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}},"required":["zip","city","state","state_name","city_source","reference_cities","location_note","area_codes","area_code_source","city_issued_area_codes","city_issued_area_code_samples","city_issued_sample_count","city_issued_history_zips","city_issued_last_observed_on","city_issued_sources","issued_sample_count","issued_last_observed_on","city_historical_area_codes","city_area_code_samples","city_sample_count","city_history_zips","city_last_observed_on","historical_area_codes","area_code_samples","reference_area_codes","reference_sources","reference_checked_on","reference_scope","sample_count","history_status","last_observed_on","area_code_guaranteed","notice","updated_at"],"nullable":true,"readOnly":true,"description":"按ZIP关联的只读参考资料；未导入时为null。更新此资料不改变目录id或revision。"},"upstream_plan_code":{"type":"string","nullable":true},"upstream_plan_id":{"type":"string","nullable":true},"verification_status":{"type":"string","enum":["matched","updated","supplemented","not_found","query_failed","ambiguous","retired"]},"available":{"type":"boolean"},"orderable":{"type":"boolean"},"currency":{"type":"string","enum":["USD"]},"prices":{"type":"object","properties":{"activate_physical":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串","nullable":true},"activate_esim":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串","nullable":true},"renew":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串","nullable":true},"reactivate":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串","nullable":true},"plan_change":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串","nullable":true}},"required":["activate_physical","activate_esim","renew","reactivate","plan_change"]},"unavailable_reason":{"type":"string","nullable":true},"checked_at":{"type":"string","nullable":true},"source_rows":{"type":"array","items":{"type":"integer"}},"source_plans":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer"},"telgoo_plan_id":{"type":"string"},"plan_code":{"type":"string"},"carrier_plan_id":{"type":"string"}},"required":["row","telgoo_plan_id","plan_code","carrier_plan_id"]}},"review_flags":{"type":"array","items":{"type":"string"}}},"required":["id","revision","plan_code","plan_name","service_address","zip_region","upstream_plan_code","upstream_plan_id","verification_status","available","orderable","currency","prices","unavailable_reason","checked_at","source_rows","source_plans","review_flags"]},"Topup":{"type":"object","properties":{"topup_code":{"type":"string"},"topup_name":{"type":"string"},"price":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"currency":{"type":"string"}},"required":["topup_code","topup_name","price","currency"]},"OrderItem":{"type":"object","properties":{"id":{"type":"string"},"iccid":{"type":"string"},"plan_code":{"type":"string"},"price":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"charged_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"status":{"type":"string","enum":["accepted","processing","pending","paused","success","failed"]},"error":{"type":"string","nullable":true},"error_code":{"type":"string","nullable":true},"change_type":{"type":"string","nullable":true},"catalog_entry_id":{"type":"string","nullable":true},"catalog_snapshot":{"type":"object","nullable":true},"mdn":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"result_source":{"type":"string","nullable":true},"wifi_calling":{"type":"object","nullable":true,"properties":{"status":{"type":"string"},"error_code":{"type":"string","nullable":true}},"required":["status","error_code"],"description":"独立 Wi-Fi Calling 结果；未返回为 null。重新激活成功而 WFC failed/skipped 时，主业务仍按成功结算；不等于 WFC 已开启。包含状态及错误码。"},"upstream_status":{"type":"string","nullable":true},"upstream_finished_at":{"type":"string","format":"date-time","nullable":true},"wifi_calling_repair":{"type":"object","nullable":true},"retryable":{"type":"boolean"},"service_address":{"type":"object","nullable":true},"attention_required":{"type":"boolean","description":"长期 pending，继续低频查询并提示核查"},"check_attempts":{"type":"integer","description":"累计自动尝试次数，含首次发送"},"next_check_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"service_period":{"$ref":"#/components/schemas/ServicePeriod"},"next_service_period":{"$ref":"#/components/schemas/ServicePeriod"}},"required":["id","iccid","plan_code","price","charged_amount","status","error","error_code","change_type","catalog_entry_id","catalog_snapshot","mdn","enrollment_id","customer_id","result_source","wifi_calling","upstream_status","upstream_finished_at","wifi_calling_repair","retryable","service_address","attention_required","check_attempts","next_check_at","created_at","updated_at"]},"Order":{"type":"object","properties":{"order_id":{"type":"string"},"txid":{"type":"string","minLength":1,"maxLength":120},"operation":{"type":"string","enum":["activate","renew","reactivate","plan_change","topup"]},"status":{"type":"string","enum":["accepted","processing","pending","paused","success","failed","partial"]},"amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"charged_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"uncharged_amount":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"15.00","description":"USD，两位小数字符串"},"currency":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"attention_required":{"type":"boolean"},"waiting_for_order_id":{"type":"string","nullable":true,"description":"因本渠道另一任务结果未明而等待时，返回该平台订单编号"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"duplicate":{"type":"boolean"}},"required":["order_id","txid","operation","status","amount","charged_amount","uncharged_amount","currency","items","attention_required","waiting_for_order_id","created_at","updated_at"]},"JobSummary":{"type":"object","properties":{"id":{"type":"string"},"txid":{"type":"string","minLength":1,"maxLength":120},"operation":{"type":"string"},"status":{"type":"string","enum":["accepted","processing","pending","paused","success","failed","partial"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","txid","operation","status","created_at","updated_at"]},"CardStatus":{"type":"object","properties":{"esn":{"type":"string"},"status":{"type":"string","enum":["FREE","ACTIVE","NOTFOUND","ERROR"]},"message":{"type":"string"},"timestamp":{"type":"string"},"mock":{"type":"boolean"},"code":{"type":"string","nullable":true},"esn_status":{"type":"string","nullable":true},"provision_status":{"type":"string","nullable":true},"mdn":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"plan_code":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"service_period":{"type":"object","nullable":true,"enum":[null],"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。"},"next_service_period":{"type":"object","nullable":true,"enum":[null],"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。"}},"required":["esn","status"]},"Customer":{"type":"object","properties":{"found":{"type":"boolean"},"esn":{"type":"string","nullable":true},"mdn":{"type":"string","nullable":true},"sim":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"plan_id":{"type":"string","nullable":true},"plan_code":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"timestamp":{"type":"string","nullable":true},"mock":{"type":"boolean"},"account_number":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"address_two":{"type":"string","nullable":true},"wfc_address":{"type":"string","nullable":true},"wfc_address_two":{"type":"string","nullable":true},"wfc_city":{"type":"string","nullable":true},"wfc_state":{"type":"string","nullable":true},"wfc_zip":{"type":"string","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"service_period":{"$ref":"#/components/schemas/ServicePeriod"},"plan_start_date":{"type":"string","nullable":true,"description":"上游當期開始時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2026-12-03T01:38:50-05:00"},"plan_expiry_date":{"type":"string","nullable":true,"description":"上游當期到期時間，不是全部已購週期的最終到期時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2026-12-03T01:38:50-05:00"},"plan_grace_expiry_date":{"type":"string","nullable":true,"description":"上游寬限期結束時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2026-12-03T01:38:50-05:00"},"next_plan_change_renew_date":{"type":"string","nullable":true,"description":"上游下期生效時間，不覆蓋當期開始時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2026-12-03T01:38:50-05:00"},"next_plan_expiry_date":{"type":"string","nullable":true,"description":"上游下期到期時間，不覆蓋當期到期時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2027-01-03T01:38:50-05:00"},"created_at":{"type":"string","nullable":true,"description":"線路記錄中上游提供的帳戶建立時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2026-12-03T01:38:50-05:00"},"approved_at":{"type":"string","nullable":true,"description":"線路記錄中上游提供的帳戶核准時間。 可唯一確定時輸出 YYYY-MM-DDTHH:mm:ss[.小數]，帶 -04:00 或 -05:00。選填；純日期、未知值及歧義時間保持原值。","example":"2026-12-03T01:38:50-05:00"},"next_service_period":{"$ref":"#/components/schemas/ServicePeriod"}},"required":["found","esn"]},"Usage":{"type":"object","properties":{"mdn":{"type":"string","nullable":true},"summary":{"type":"boolean"},"from":{"type":"string","nullable":true},"to":{"type":"string","nullable":true},"data_used":{"type":"string","nullable":true},"data_remaining":{"type":"string","nullable":true},"data_limit":{"type":"string","nullable":true},"talk_used":{"type":"string","nullable":true},"talk_remaining":{"type":"string","nullable":true},"text_used":{"type":"string","nullable":true},"text_remaining":{"type":"string","nullable":true},"line_status":{"type":"string","nullable":true},"timestamp":{"type":"string","nullable":true},"records":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"data_used":{},"talk_used":{},"text_used":{}},"required":[]}},"mock":{"type":"boolean"},"talk_limit":{"type":"string","nullable":true,"description":"當期套餐通話總額度，單位分鐘。"},"text_limit":{"type":"string","nullable":true,"description":"當期套餐短訊總額度，接收和發送共用。"},"data_unlimited":{"type":"boolean","nullable":true,"description":"true 表示不限量；null 表示未知。"},"talk_unlimited":{"type":"boolean","nullable":true,"description":"true 表示不限量；null 表示未知。"},"text_unlimited":{"type":"boolean","nullable":true,"description":"true 表示不限量；null 表示未知。"},"usage_units":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"string","enum":["MB"]},"talk":{"type":"string","enum":["minute"]},"text":{"type":"string","enum":["message"]}},"required":["data","talk","text"],"description":"無單位數值分別按 MB、分鐘、條讀取；原有帶單位字串保留原樣。"},"service_period":{"$ref":"#/components/schemas/ServicePeriod"},"current_usage":{"type":"object","nullable":true,"additionalProperties":false,"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"data_used":{"type":"string","nullable":true},"talk_used":{"type":"string","nullable":true},"text_used":{"type":"string","nullable":true},"timestamp":{"type":"string","format":"date-time","nullable":true}},"required":["from","to","data_used","talk_used","text_used","timestamp"],"description":"本期起始日至所列查詢日期的計費用量，單位見 usage_units。不可取得時為 null；原有頂層已用量欄位仍對應原請求區間。"},"next_service_period":{"$ref":"#/components/schemas/ServicePeriod"}},"required":["mdn","summary","records"]},"ServicePeriod":{"type":"object","nullable":true,"additionalProperties":false,"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。","required":["status","source","period_kind","date_timezone","effective_date","expiry_date"],"properties":{"status":{"type":"string","enum":["confirmed","unknown","needs_review"]},"source":{"type":"string","enum":["upstream"]},"period_kind":{"type":"string","enum":["current","next"]},"date_timezone":{"type":"string","enum":["America/New_York"]},"effective_date":{"type":"string","format":"date","nullable":true,"description":"上游明確開始日；未提供為 null。"},"expiry_date":{"type":"string","format":"date","nullable":true,"description":"上游明確到期日；未提供為 null。"},"current_cycle_end_date":{"type":"string","format":"date","nullable":true,"description":"上游明確當期到期日，與下期分開。"},"effective_at":{"type":"string","format":"date-time","nullable":true,"description":"明確生效時刻與偏移；僅有日期時為 null。"},"expiry_at":{"type":"string","format":"date-time","nullable":true,"description":"明確到期時刻與偏移；僅有日期時為 null。"},"current_cycle_end_at":{"type":"string","format":"date-time","nullable":true,"description":"明確當期到期時刻。"},"success_date":{"type":"string","format":"date","nullable":true,"description":"實際完成或確認成功日期，不以此推算套餐週期。"},"success_date_basis":{"type":"string","nullable":true,"enum":["upstream_finished_at","first_success_confirmed_at",null]},"as_of_date":{"type":"string","format":"date","nullable":true,"description":"觀察日期。"},"observed_at":{"type":"string","format":"date-time","nullable":true,"description":"觀察或回執時刻。"},"reason":{"type":"string","nullable":true}}},"InventoryServicePeriod":{"type":"object","nullable":true,"additionalProperties":false,"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。","required":["status","source","period_kind","date_timezone","effective_date","expiry_date"],"properties":{"status":{"type":"string","enum":["confirmed","unknown","needs_review"]},"source":{"type":"string","enum":["upstream"]},"period_kind":{"type":"string","enum":["current","next"]},"date_timezone":{"type":"string","enum":["America/New_York"]},"effective_date":{"type":"string","format":"date","nullable":true,"description":"上游明確開始日；未提供為 null。"},"expiry_date":{"type":"string","format":"date","nullable":true,"description":"上游明確到期日；未提供為 null。"},"current_cycle_end_date":{"type":"string","format":"date","nullable":true,"description":"上游明確當期到期日，與下期分開。"},"effective_at":{"type":"string","format":"date-time","nullable":true,"description":"明確生效時刻與偏移；僅有日期時為 null。"},"expiry_at":{"type":"string","format":"date-time","nullable":true,"description":"明確到期時刻與偏移；僅有日期時為 null。"},"current_cycle_end_at":{"type":"string","format":"date-time","nullable":true,"description":"明確當期到期時刻。"},"success_date":{"type":"string","format":"date","nullable":true,"description":"實際完成或確認成功日期，不以此推算套餐週期。"},"success_date_basis":{"type":"string","nullable":true,"enum":["upstream_finished_at","first_success_confirmed_at",null]},"as_of_date":{"type":"string","format":"date","nullable":true,"description":"觀察日期。"},"observed_at":{"type":"string","format":"date-time","nullable":true,"description":"觀察或回執時刻。"},"reason":{"type":"string","nullable":true}}},"LatestHandling":{"type":"object","nullable":true,"additionalProperties":false,"required":["operation","date","date_range","date_kind","date_basis","date_timezone"],"properties":{"operation":{"type":"string","enum":["activate","renew","reactivate"]},"date":{"type":"string","format":"date","nullable":true},"date_range":{"type":"array","nullable":true,"minItems":2,"maxItems":2,"items":{"type":"string","format":"date"}},"date_kind":{"type":"string","enum":["handled"]},"date_basis":{"type":"string","enum":["recorded"]},"date_timezone":{"type":"string","enum":["America/New_York"]},"handled_at":{"type":"string","nullable":true,"format":"date-time"},"time_basis":{"type":"string","nullable":true},"source":{"type":"string","enum":["order","history"]},"job_id":{"type":"string","nullable":true},"txid":{"type":"string","nullable":true},"effective_date":{"type":"string","nullable":true,"format":"date"}},"description":"最新成功的本地辦理。date/date_range 保留日期精度，沒有確切時刻時 handled_at 為 null。time_basis 區分上游完成、首次成功確認與歷史依據。待辦、失敗、僅排期不延長週期。"},"CustomerLine":{"$ref":"#/components/schemas/Customer"},"Meta":{"type":"object","properties":{"request_id":{"type":"string"},"job_id":{"type":"string"},"txid":{"type":"string"}}},"QueryIdentifiers":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"esn":{"type":"string","pattern":"^\\d{18,22}$"},"mdn":{"type":"string","pattern":"^\\d{10}$"},"enrollment_id":{"type":"string","minLength":1,"maxLength":100}},"description":"至少提供一個已登記標識；同傳多個時必須屬於同一張卡。"},"QueryJobItem":{"type":"object","properties":{"id":{"type":"string"},"index":{"type":"integer"},"status":{"type":"string","enum":["accepted","processing","pending","succeeded","review"]},"identifiers":{"$ref":"#/components/schemas/QueryIdentifiers"},"attempt_count":{"type":"integer"},"next_check_at":{"type":"string","format":"date-time","nullable":true},"result":{"type":"object","properties":{"found":{"type":"boolean"},"esn":{"type":"string","nullable":true},"mdn":{"type":"string","nullable":true},"sim":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"plan_id":{"type":"string","nullable":true},"plan_code":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"timestamp":{"type":"string","nullable":true},"mock":{"type":"boolean"},"account_number":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"address_two":{"type":"string","nullable":true},"wfc_address":{"type":"string","nullable":true},"wfc_address_two":{"type":"string","nullable":true},"wfc_city":{"type":"string","nullable":true},"wfc_state":{"type":"string","nullable":true},"wfc_zip":{"type":"string","nullable":true},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"service_period":{"$ref":"#/components/schemas/ServicePeriod"}},"required":["found","esn"],"nullable":true},"error_code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true}}},"QueryJobResult":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string"},"txid":{"type":"string"},"type":{"type":"string","enum":["query"]},"status":{"type":"string","enum":["pending","succeeded","partial","review"]},"revision":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":"string","format":"date-time","nullable":true}}},"items":{"type":"array","items":{"$ref":"#/components/schemas/QueryJobItem"}}}},"QueryCompletedEvent":{"type":"object","required":["id","type","data"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["query.job.completed"]},"created_at":{"type":"string","format":"date-time"},"data":{"$ref":"#/components/schemas/QueryJobResult"}}},"QueryCallback":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","delivering","delivered","failed"]},"attempts":{"type":"integer"},"cycle_attempts":{"type":"integer"},"next_attempt":{"type":"string","format":"date-time"},"last_error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"NumberOverview":{"type":"object","additionalProperties":false,"required":["mdn","line","usage","partial","usage_error"],"properties":{"mdn":{"type":"string","pattern":"^\\d{10}$"},"line":{"type":"object","additionalProperties":false,"required":["found","service_period","next_service_period"],"properties":{"found":{"type":"boolean"},"mdn":{"type":"string","nullable":true},"esn":{"type":"string","nullable":true},"sim":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"plan_id":{"type":"string","nullable":true},"plan_code":{"type":"string","nullable":true},"plan_name":{"type":"string","nullable":true},"timestamp":{"type":"string","nullable":true},"queried_at":{"type":"string","nullable":true},"plan_start_date":{"type":"string","nullable":true},"plan_expiry_date":{"type":"string","nullable":true},"plan_grace_expiry_date":{"type":"string","nullable":true},"next_plan_change_renew_date":{"type":"string","nullable":true},"next_plan_expiry_date":{"type":"string","nullable":true},"wifi_calling_enabled":{"type":"boolean","nullable":true},"service_period":{"type":"object","nullable":true,"additionalProperties":false,"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。","required":["status","source","period_kind","date_timezone","effective_date","expiry_date"],"properties":{"status":{"type":"string","enum":["confirmed","unknown","needs_review"]},"source":{"type":"string","enum":["upstream"]},"period_kind":{"type":"string","enum":["current","next"]},"date_timezone":{"type":"string","enum":["America/New_York"]},"effective_date":{"type":"string","format":"date","nullable":true,"description":"上游明確開始日；未提供為 null。"},"expiry_date":{"type":"string","format":"date","nullable":true,"description":"上游明確到期日；未提供為 null。"},"current_cycle_end_date":{"type":"string","format":"date","nullable":true,"description":"上游明確當期到期日，與下期分開。"},"effective_at":{"type":"string","format":"date-time","nullable":true,"description":"明確生效時刻與偏移；僅有日期時為 null。"},"expiry_at":{"type":"string","format":"date-time","nullable":true,"description":"明確到期時刻與偏移；僅有日期時為 null。"},"current_cycle_end_at":{"type":"string","format":"date-time","nullable":true,"description":"明確當期到期時刻。"},"success_date":{"type":"string","format":"date","nullable":true,"description":"實際完成或確認成功日期，不以此推算套餐週期。"},"success_date_basis":{"type":"string","nullable":true,"enum":["upstream_finished_at","first_success_confirmed_at",null]},"as_of_date":{"type":"string","format":"date","nullable":true,"description":"觀察日期。"},"observed_at":{"type":"string","format":"date-time","nullable":true,"description":"觀察或回執時刻。"},"reason":{"type":"string","nullable":true}}},"next_service_period":{"type":"object","nullable":true,"additionalProperties":false,"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不儲存或返回當前線路狀態和到期日，週期欄位為 null。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。","required":["status","source","period_kind","date_timezone","effective_date","expiry_date"],"properties":{"status":{"type":"string","enum":["confirmed","unknown","needs_review"]},"source":{"type":"string","enum":["upstream"]},"period_kind":{"type":"string","enum":["current","next"]},"date_timezone":{"type":"string","enum":["America/New_York"]},"effective_date":{"type":"string","format":"date","nullable":true,"description":"上游明確開始日；未提供為 null。"},"expiry_date":{"type":"string","format":"date","nullable":true,"description":"上游明確到期日；未提供為 null。"},"current_cycle_end_date":{"type":"string","format":"date","nullable":true,"description":"上游明確當期到期日，與下期分開。"},"effective_at":{"type":"string","format":"date-time","nullable":true,"description":"明確生效時刻與偏移；僅有日期時為 null。"},"expiry_at":{"type":"string","format":"date-time","nullable":true,"description":"明確到期時刻與偏移；僅有日期時為 null。"},"current_cycle_end_at":{"type":"string","format":"date-time","nullable":true,"description":"明確當期到期時刻。"},"success_date":{"type":"string","format":"date","nullable":true,"description":"實際完成或確認成功日期，不以此推算套餐週期。"},"success_date_basis":{"type":"string","nullable":true,"enum":["upstream_finished_at","first_success_confirmed_at",null]},"as_of_date":{"type":"string","format":"date","nullable":true,"description":"觀察日期。"},"observed_at":{"type":"string","format":"date-time","nullable":true,"description":"觀察或回執時刻。"},"reason":{"type":"string","nullable":true}}}},"description":"本次即時核實的線路資料；線路狀態、當期／下期週期及查詢時刻獨立於餘量。"},"usage":{"type":"object","properties":{"mdn":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"summary":{"type":"boolean"},"from":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"to":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"data_used":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"data_remaining":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"data_limit":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"talk_used":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"talk_remaining":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"text_used":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"text_remaining":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"line_status":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"timestamp":{"type":"string","nullable":true,"description":"用量回包中的狀態；本次核實的線路狀態請讀取 line.status。"},"records":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"data_used":{},"talk_used":{},"text_used":{}},"required":[]}},"mock":{"type":"boolean"},"talk_limit":{"type":"string","nullable":true,"description":"當期套餐通話總額度，單位分鐘。"},"text_limit":{"type":"string","nullable":true,"description":"當期套餐短訊總額度，接收和發送共用。"},"data_unlimited":{"type":"boolean","nullable":true,"description":"true 表示不限量；null 表示未知。"},"talk_unlimited":{"type":"boolean","nullable":true,"description":"true 表示不限量；null 表示未知。"},"text_unlimited":{"type":"boolean","nullable":true,"description":"true 表示不限量；null 表示未知。"},"usage_units":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"string","enum":["MB"]},"talk":{"type":"string","enum":["minute"]},"text":{"type":"string","enum":["message"]}},"required":["data","talk","text"],"description":"無單位數值分別按 MB、分鐘、條讀取；原有帶單位字串保留原樣。"},"service_period":{"$ref":"#/components/schemas/ServicePeriod"},"current_usage":{"type":"object","nullable":true,"additionalProperties":false,"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"data_used":{"type":"string","nullable":true},"talk_used":{"type":"string","nullable":true},"text_used":{"type":"string","nullable":true},"timestamp":{"type":"string","format":"date-time","nullable":true}},"required":["from","to","data_used","talk_used","text_used","timestamp"],"description":"當期計費用量；頂層 *_used 使用相同數值。未知或混入週期開始前用量的項目保留 null。"},"next_service_period":{"$ref":"#/components/schemas/ServicePeriod"}},"required":["mdn","summary","records"],"nullable":true,"description":"本期起始日至美東今天的用量，不使用預設 90 天彙總。整份用量無法取得時為 null。"},"partial":{"type":"boolean","description":"線路結果已取得、整份用量未取得時為 true，原因見 usage_error。partial=false 時個別未知數值仍可能為 null。"},"usage_error":{"type":"object","nullable":true,"additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"LocalInventoryExpiry":{"type":"object","additionalProperties":false,"description":"僅查本地庫，不呼叫上游、不提交業務、不扣款。同一身份與週期已有確認日期時優先採用；expiry_info 是歷史／推算的已購週期截止，不代表目前線路狀態或即時 service_period。當期查詢不抹去已成功購買的後續週期。依據不足或衝突保持未知。未使用空卡仍僅提供數量。","properties":{"status":{"type":"string","enum":["confirmed","estimated","unknown"]},"expiry_date":{"type":"string","nullable":true,"format":"date"},"expiry_at":{"type":"string","nullable":true,"format":"date-time"},"expiry_date_range":{"type":"array","nullable":true,"minItems":2,"maxItems":2,"items":{"type":"string","format":"date"}},"source":{"type":"string","nullable":true,"enum":["saved_query","receipt","handling_history",null]},"basis":{"type":"string","nullable":true},"confirmed_at":{"type":"string","nullable":true,"format":"date-time"},"current_cycle_end_date":{"type":"string","nullable":true,"format":"date"},"current_cycle_status":{"type":"string","enum":["confirmed","estimated","unknown"]},"date_timezone":{"type":"string","enum":["America/New_York"]},"as_of_date":{"type":"string","nullable":true,"format":"date"},"last_observed_at":{"type":"string","nullable":true,"format":"date-time"},"identity_current":{"type":"boolean","nullable":true},"reason":{"type":"string","nullable":true}},"required":["status","expiry_date","expiry_at","expiry_date_range","source","basis","confirmed_at","current_cycle_end_date","current_cycle_status","date_timezone","as_of_date","last_observed_at","identity_current","reason"]}}},"paths":{"/cards/{iccid}/esim":{"get":{"summary":"读取本渠道 eSIM 安装资料","parameters":[{"name":"iccid","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9]{18,22}$"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"iccid":{"type":"string"},"activation_string":{"type":"string"},"created_at":{"type":"string"}},"required":["iccid","activation_string","created_at"]}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"返回本渠道已提供的 LPA 安装字符串，不生成新的安装码；未提供为 404。资料敏感，不要公开缓存或记录完整值。"}},"/cards/{iccid}/sync":{"post":{"summary":"同步已归属卡的号码和套餐资料","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"iccid":{"type":"string"},"mdn":{"type":"string","nullable":true},"enrollment_id":{"type":"string","nullable":true},"plan_code":{"type":"string","nullable":true},"status":{"type":"string","enum":["unassigned","free","used"],"description":"库存使用事实：未分配、未使用、已使用；不表示线路 Active/Inactive。线路状态和当期日期请实时查询综合接口。"},"last_synced_at":{"type":"string","nullable":true}},"required":["iccid","mdn","enrollment_id","plan_code","status","last_synced_at"]}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"iccid","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9]{18,22}$"}}],"description":"实时核对卡与线路标识后更新已登记资料；不保存线路状态或到期日，不创建业务订单、不扣款。每次一张，传空 JSON 对象；办理中的卡、无法唯一匹配的套餐或号码冲突拒绝同步。"}},"/balance":{"get":{"summary":"渠道预存款余额","parameters":[],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"oneOf":[{"$ref":"#/components/schemas/Wallet"},{"$ref":"#/components/schemas/HuiWallet"}]}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/cards":{"get":{"summary":"本渠道卡号","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000,"default":1}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"stock_state","in":"query","required":false,"schema":{"type":"string","enum":["activated","unused"],"default":"activated"}},{"name":"mdn","in":"query","schema":{"type":"string","pattern":"^\\d{10}$"}},{"name":"iccid","in":"query","schema":{"type":"string","pattern":"^\\d{18,22}$"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"summary":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"activated":{"type":"integer","minimum":0},"unused":{"type":"integer","minimum":0},"by_type":{"type":"object","properties":{"physical":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"activated":{"type":"integer","minimum":0},"unused":{"type":"integer","minimum":0}},"required":["total","activated","unused"]},"esim":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"activated":{"type":"integer","minimum":0},"unused":{"type":"integer","minimum":0}},"required":["total","activated","unused"]},"unknown":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"activated":{"type":"integer","minimum":0},"unused":{"type":"integer","minimum":0}},"required":["total","activated","unused"]}},"required":["physical","esim","unknown"]}},"required":["total","activated","unused","by_type"]}},"required":["success","data","pagination","summary"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"線路 service_period 與 next_service_period 只取本次核實身份的上游即時回包，當期與下期分開；缺失日期為 null。庫存列表不返回權威的當前線路狀態或即時週期，service_period 欄位為 null；另以 expiry_info 提供歷史確認／推算的已購週期截止。查單週期僅為當次業務歷史憑據。直接辦理會核實線路。自動辦理先按相符的已購日期分流，必要時查詢線路。原始查詢和業務回執保留供核對。\n\n僅查本地庫，不呼叫上游、不提交業務、不扣款。同一身份與週期已有確認日期時優先採用；expiry_info 是歷史／推算的已購週期截止，不代表目前線路狀態或即時 service_period。當期查詢不抹去已成功購買的後續週期。依據不足或衝突保持未知。未使用空卡仍僅提供數量。\n\n單查傳 mdn 或 iccid，兩者只能選一個；均省略則分頁列出可見卡片。單查保留陣列與分頁結構。手機號碼採用最新已確認的本地激活綁定；未找到或不屬於本渠道返回空陣列。重查舊卡不改變已確認的目前綁定。"}},"/ledger":{"get":{"summary":"本渠道充值和消耗明细","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","description":"开始日期，按 America/New_York（华盛顿特区）计算，含当天，自动处理夏令时"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","description":"结束日期，按 America/New_York（华盛顿特区）计算，含当天，自动处理夏令时"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000,"default":1}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEntry"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"summary":{"$ref":"#/components/schemas/LedgerSummary"}},"required":["success","data","pagination","summary"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"日期为资金实际入账 / 扣款时间；不传日期查询全部。summary 覆盖全部筛选结果，不受分页影响。金额均为 USD 字符串。"}},"/ledger/summary":{"get":{"summary":"本渠道资金期间汇总","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","description":"开始日期，按 America/New_York（华盛顿特区）计算，含当天，自动处理夏令时"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","description":"结束日期，按 America/New_York（华盛顿特区）计算，含当天，自动处理夏令时"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/LedgerSummary"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"期初余额为 from 之前的余额；期末 = 期初 + 期间充值 - 实际消耗 + recorded_amount（如有）；current_balance 为当前余额。仅记账账户余额允许为负，不代表已收款。无 from 时期初为 0。"}},"/ledger/export":{"get":{"summary":"导出本渠道完整账单 CSV","description":"UTF-8 BOM，按入账时间升序；覆盖全部日期筛选结果，忽略 page/per_page。长编号前加单引号避免表格软件截断。","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","description":"开始日期，按 America/New_York（华盛顿特区）计算，含当天，自动处理夏令时"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","description":"结束日期，按 America/New_York（华盛顿特区）计算，含当天，自动处理夏令时"}}],"responses":{"200":{"description":"完整账单","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/regional-catalog":{"get":{"summary":"已保存的地区套餐目录","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000,"default":1}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"catalog_entry_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":250,"pattern":"\\S","description":"按目录唯一编码读取记录；仍返回 data 数组，无匹配时为空数组。"}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{5}$"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"area_code","in":"query","required":false,"schema":{"type":"string","pattern":"^[2-9]\\d{2}$","description":"地区或历史号码的三位区号，仅供查询参考"}},{"name":"plan_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"verification_status","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["spreadsheet","supplemented"]}},{"name":"orderable","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/RegionalCatalog"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"summary":{"type":"object"},"sync":{"type":"object","nullable":true},"card_fees":{"type":"object","properties":{"physical":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"1.25","description":"实体卡单价，未设置为 null。","nullable":true},"esim":{"type":"string","pattern":"^\\d+\\.\\d{2}$","example":"1.75","description":"eSIM 卡单价，未设置为 null。","nullable":true}},"required":["physical","esim"],"additionalProperties":false,"description":"当前渠道在售价设置中保存的卡费单价，单位 USD。每页均返回，独立于套餐报价。"}},"required":["success","data","pagination","card_fees"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"一次读取套餐、完整服务地址、城市与参考区号、本渠道售价及目录唯一编码。只返回可下单记录；可用 catalog_entry_id 筛选记录，停用或不可下单的编码返回空数组。仍须检查对应业务报价，summary 为全部筛选结果的汇总。"}},"/topups":{"get":{"summary":"未开放的加购目录","deprecated":true,"description":"所有渠道认证方式均返回 403 CAPABILITY_DISABLED。","responses":{"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/esns/{esn}/status":{"get":{"summary":"查询本渠道卡号状态","parameters":[{"name":"esn","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CardStatus"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers":{"get":{"summary":"号码资料","parameters":[{"name":"esn","in":"query","required":false,"schema":{"type":"string"}},{"name":"mdn","in":"query","required":false,"schema":{"type":"string"}},{"name":"enrollment_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Customer"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"esn、mdn、enrollment_id 必须且只能提供一个；先验证卡号归属。 平台先核實渠道歸屬，使用原登記帳號按 ICCID 查詢。若未找到線路、資料不完整或身份不符，再依序使用已登記的原登記編號、原手機號碼。缺少的標識會跳過。每次只傳一個標識，每個標識最多查一次。取得完整且符合原卡的資料即停止。遇到限流、逾時或暫時網路錯誤立即返回並記錄，不通知員工。身份衝突仍未解決、帳號或平台故障時記錄異常。"}},"/mdns/{mdn}":{"get":{"summary":"按手机号查询本渠道号码资料","parameters":[{"name":"mdn","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{10}$"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Customer"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":" 平台先核實渠道歸屬，使用原登記帳號按 ICCID 查詢。若未找到線路、資料不完整或身份不符，再依序使用已登記的原登記編號、原手機號碼。缺少的標識會跳過。每次只傳一個標識，每個標識最多查一次。取得完整且符合原卡的資料即停止。遇到限流、逾時或暫時網路錯誤立即返回並記錄，不通知員工。身份衝突仍未解決、帳號或平台故障時記錄異常。"}},"/mdns/{mdn}/usage":{"get":{"summary":"号码用量","parameters":[{"name":"mdn","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{10}$"}},{"name":"summary","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Usage"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"最近 90 天。默认汇总；起止日期同时填写则逐日查询，不能与 summary=true 同用。按返回字符串及单位读取用量；逐日记录可包含 date/data_used/talk_used/text_used，不将缺失字段或 null 视为零。\n\n當期額度：data_limit／talk_limit／text_limit 採用已核實線路的當期 plan_data／plan_talk／plan_sms。有效的上游餘量（包括 0）優先採用；未提供時按 max(總額度－本期計費用量, 0) 返回餘量。不限量以 *_unlimited=true 表示，不使用數字額度。單位、用量或週期邊界不明時保持 null。短訊收發共用額度，通話已用量包含計費語音信箱分鐘。預設 summary=true 保留原有 90 天用量和明細；缺少餘量時，同次同步請求最多補查一次本期用量並放在 current_usage。補查失敗時該餘量保持未知，原成功查詢仍正常返回。指定日期查詢只有在覆蓋美東當期起始日至今天時補齊額度；歷史和部分區間保留原值。下期已購資源不加入本期總量。這些數值不用於判定線路狀態或觸發辦理。"}},"/jobs/activations":{"post":{"summary":"开卡；仅支持 ICCID 和地区套餐目录","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"txid":{"type":"string","minLength":1,"maxLength":120},"esns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","pattern":"^[0-9]{18,22}$"},"description":"本渠道名下 ICCID 数组，不设置固定批次条数上限"},"catalog_entry_id":{"type":"string","description":"GET /regional-catalog 返回的目录 ID，包含地区套餐映射及参考服务地址"},"catalog_revision":{"type":"string","deprecated":true,"description":"兼容字段，无需传入，不再按版本号拒绝请求；仍按 catalog_entry_id 校验当前可办理目录、报价及余额，并保存受理快照。"}},"required":["txid","esns","catalog_entry_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"幂等重试返回原订单；成功明细不重复扣款","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"202":{"description":"已受理；仅逐卡 success 才扣款","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"旧版格式仅接受 esns（ICCID 数组）及必填 catalog_entry_id，平台据此补齐套餐和地址；catalog_revision 仅保留兼容，不影响受理。不能单独传套餐、地址、手机号或 Enrollment ID。新接入使用固定 Key 标头及新版 items 格式。订单保存目录和地址快照，区号仅供参考，以实际号码为准。\n\n仅对新受理的激活明细：办理结果明确 failed、error_code=rate_limited 且 retryable=true 时，平台直接在原渠道批次中自动补救，不增加补救冷却或额外原任务、库存查询，最多两次。每次优先从最近有成功记录的激活批次中，随机选一个可用且未尝试过的同套餐目录，并使用其地址；不限渠道、可跨日期，该批次没有合适目录时再依次查找前面的批次；报价、ICCID 和渠道任务编号保持。无候选、两次仍失败或资料冲突转人工处理。补救中返回 running/pending、next_action=wait，不先发送最终失败回调；最后只按最终结果通知，成功只扣款一次。超时或结果不明仅查原任务，不换目录；渠道不要重复提交。\n\n已受理后无法自动恢复的业务异常保持处理中并告警员工，人工核实完成后才回调终态；已成功明细正常一次结算和回调。内部 WFC 补救独立处理，不拖住主业务。连续 5 分钟无新进展提醒员工，仍查询原任务，不判失败或重新办理。渠道明确输入错误仍拒绝。"}},"/jobs/reactivations":{"post":{"summary":"重新激活原线路；按续费价格计费","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"txid":{"type":"string","minLength":1,"maxLength":120},"esns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"本渠道名下 ICCID 数组，不设置固定批次条数上限"},"mdns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","pattern":"^\\d{10}$"},"description":"本渠道已登记的美国 10 位手机号；未登记号码不能办理业务或查询其他渠道资料"},"enrollment_ids":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}},"plan_code":{"type":"string","minLength":1,"maxLength":60},"zip_code":{"type":"string","pattern":"^\\d{5}$"},"catalog_entry_id":{"type":"string","description":"GET /regional-catalog 返回的目录 ID，包含地区套餐映射及参考服务地址"},"catalog_revision":{"type":"string","deprecated":true,"description":"兼容字段，无需传入，不再按版本号拒绝请求；仍按 catalog_entry_id 校验当前可办理目录、报价及余额，并保存受理快照。"}},"required":["txid"],"oneOf":[{"required":["esns"],"not":{"anyOf":[{"required":["mdns"]},{"required":["enrollment_ids"]}]}},{"required":["mdns"],"not":{"anyOf":[{"required":["esns"]},{"required":["enrollment_ids"]}]}},{"required":["enrollment_ids"],"not":{"anyOf":[{"required":["esns"]},{"required":["mdns"]}]}}]}}}},"responses":{"200":{"description":"幂等重试返回原订单；成功明细不重复扣款","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"202":{"description":"已受理；仅逐卡 success 才扣款","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"恢复原线路，operation=reactivate。默认沿用原套餐；首次导入且缺少套餐记录时提供 plan_code 或 catalog_entry_id。不能换套餐，不接受 service_address、change_type、enrollment_type 或 topup_code。按本渠道续费售价检查整批余额，逐卡成功后扣款，不计卡费；办理前核对原套餐和号码。库存登记状态不代表恢复资格，能否恢复、号码保留期限和有效期需由平台核实。"}},"/jobs/renewals":{"post":{"summary":"续费；保留剩余天数或立即开始新周期","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"txid":{"type":"string","minLength":1,"maxLength":120},"esns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"本渠道名下 ICCID 数组，不设置固定批次条数上限"},"mdns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","pattern":"^\\d{10}$"},"description":"本渠道已登记的美国 10 位手机号；未登记号码不能办理业务或查询其他渠道资料"},"enrollment_ids":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}},"plan_code":{"type":"string","minLength":1,"maxLength":60},"zip_code":{"type":"string","pattern":"^\\d{5}$"},"catalog_entry_id":{"type":"string","description":"GET /regional-catalog 返回的目录 ID，包含地区套餐映射及参考服务地址"},"catalog_revision":{"type":"string","deprecated":true,"description":"兼容字段，无需传入，不再按版本号拒绝请求；仍按 catalog_entry_id 校验当前可办理目录、报价及余额，并保存受理快照。"},"change_type":{"type":"string","enum":["IMMEDIATE","ONEXPIRY"],"default":"IMMEDIATE","description":"新订单默认 IMMEDIATE；重复交易沿用原订单已保存的方式。"}},"required":["txid"],"oneOf":[{"required":["esns"],"not":{"anyOf":[{"required":["mdns"]},{"required":["enrollment_ids"]}]}},{"required":["mdns"],"not":{"anyOf":[{"required":["esns"]},{"required":["enrollment_ids"]}]}},{"required":["enrollment_ids"],"not":{"anyOf":[{"required":["esns"]},{"required":["mdns"]}]}}]}}}},"responses":{"200":{"description":"幂等重试返回原订单；成功明细不重复扣款","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"202":{"description":"已受理；仅逐卡 success 才扣款","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"ONEXPIRY 保留当前周期，从现有到期日增加一个套餐月；IMMEDIATE 从办理当日重新开始一个套餐周期，并提供新的资源量。不能传指定日期或月数。同号码未完成业务返回 CARD_BUSY。连续续费须确认上一笔成功并核实到期日已延长，不能并发；当前接口未提供统一到期日字段，目前不提供自动多月续费。不指定套餐或目录ID时沿用原套餐；换套餐续费可选同地区目标目录。有待生效套餐时须明确指定。\n\n已受理后无法自动恢复的业务异常保持处理中并告警员工，人工核实完成后才回调终态；已成功明细正常一次结算和回调。内部 WFC 补救独立处理，不拖住主业务。连续 5 分钟无新进展提醒员工，仍查询原任务，不判失败或重新办理。渠道明确输入错误仍拒绝。"}},"/jobs/plan-changes":{"post":{"summary":"独立更换套餐；使用独立报价","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"txid":{"type":"string","minLength":1,"maxLength":120},"esns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"本渠道名下 ICCID 数组，不设置固定批次条数上限"},"mdns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","pattern":"^\\d{10}$"},"description":"本渠道已登记的美国 10 位手机号；未登记号码不能办理业务或查询其他渠道资料"},"enrollment_ids":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}},"plan_code":{"type":"string","minLength":1,"maxLength":60},"zip_code":{"type":"string","pattern":"^\\d{5}$"},"catalog_entry_id":{"type":"string","description":"GET /regional-catalog 返回的目录 ID，包含地区套餐映射及参考服务地址"},"catalog_revision":{"type":"string","deprecated":true,"description":"兼容字段，无需传入，不再按版本号拒绝请求；仍按 catalog_entry_id 校验当前可办理目录、报价及余额，并保存受理快照。"},"change_type":{"type":"string","enum":["IMMEDIATE","ONEXPIRY"],"default":"IMMEDIATE"}},"required":["txid"],"oneOf":[{"required":["esns"],"not":{"anyOf":[{"required":["mdns"]},{"required":["enrollment_ids"]}]}},{"required":["mdns"],"not":{"anyOf":[{"required":["esns"]},{"required":["enrollment_ids"]}]}},{"required":["enrollment_ids"],"not":{"anyOf":[{"required":["esns"]},{"required":["mdns"]}]}}],"anyOf":[{"required":["catalog_entry_id"]},{"required":["plan_code"]}]}}}},"responses":{"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"当前未开放；所有渠道认证方式均返回 403 CAPABILITY_DISABLED，不创建订单、不请求业务服务、不扣款。保留路径仅供旧接入识别错误。","deprecated":true}},"/jobs/topups":{"post":{"summary":"加购流量、通话或短信包","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"txid":{"type":"string","minLength":1,"maxLength":120},"esns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"},"description":"本渠道名下 ICCID 数组，不设置固定批次条数上限"},"mdns":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","pattern":"^\\d{10}$"},"description":"本渠道已登记的美国 10 位手机号；未登记号码不能办理业务或查询其他渠道资料"},"enrollment_ids":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}},"topup_code":{"type":"string","minLength":1,"maxLength":60},"zip_code":{"type":"string","pattern":"^\\d{5}$"}},"required":["txid","topup_code"],"oneOf":[{"required":["esns"],"not":{"anyOf":[{"required":["mdns"]},{"required":["enrollment_ids"]}]}},{"required":["mdns"],"not":{"anyOf":[{"required":["esns"]},{"required":["enrollment_ids"]}]}},{"required":["enrollment_ids"],"not":{"anyOf":[{"required":["esns"]},{"required":["mdns"]}]}}]}}}},"responses":{"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"当前未开放；所有渠道认证方式均返回 403 CAPABILITY_DISABLED，不创建订单、不请求业务服务、不扣款。保留路径仅供旧接入识别错误。","deprecated":true}},"/jobs":{"get":{"summary":"本渠道任务列表","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000,"default":1}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date","description":"开始日期，按订单提交时间的 Asia/Shanghai（北京时间）计算，含当天；不同于资金流水的 America/New_York 日期口径"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date","description":"结束日期，按订单提交时间的 Asia/Shanghai（北京时间）计算，含当天；不同于资金流水的 America/New_York 日期口径"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["accepted","processing","pending","paused","success","failed","partial"]}},{"name":"txid","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":120}},{"name":"attention","in":"query","required":false,"schema":{"type":"string","enum":["required"],"description":"只查自动查询耗尽且结果仍未明的任务"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/JobSummary"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["success","data","pagination"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}":{"get":{"summary":"按平台订单编号或渠道 txid 查询","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"schema":{"type":"string","enum":["order_id","txid"],"description":"明确按平台 order_id 或渠道 txid 查找。省略时兼容两种编号；若同时匹配不同订单，返回 409 AMBIGUOUS_ORDER_IDENTIFIER，必须指定类型后重试。适用于查单、明细、补查、恢复和失败重试。"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/items":{"get":{"summary":"任务逐卡处理明细","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"schema":{"type":"string","enum":["order_id","txid"],"description":"明确按平台 order_id 或渠道 txid 查找。省略时兼容两种编号；若同时匹配不同订单，返回 409 AMBIGUOUS_ORDER_IDENTIFIER，必须指定类型后重试。适用于查单、明细、补查、恢复和失败重试。"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["accepted","processing","pending","paused","success","failed"]}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/recheck":{"post":{"summary":"安排补查待确认任务","description":"仅 pending 可用；重置自动查询次数并查询原处理任务，不重新提交业务、不直接扣款。id 可为平台订单号或渠道 txid；每任务补查 / 恢复共限 1 次 / 30 秒。","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"schema":{"type":"string","enum":["order_id","txid"],"description":"明确按平台 order_id 或渠道 txid 查找。省略时兼容两种编号；若同时匹配不同订单，返回 409 AMBIGUOUS_ORDER_IDENTIFIER，必须指定类型后重试。适用于查单、明细、补查、恢复和失败重试。"}}],"requestBody":{"required":false,"description":"无需参数；请求体留空或发送空 JSON 对象，不接受其他字段。","content":{"application/json":{"schema":{"type":"object","additionalProperties":false},"example":{}}}},"responses":{"202":{"description":"已安排处理","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"请求体超过 200,000 字节","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/resume":{"post":{"summary":"检查余额并恢复暂停任务","description":"仅有 paused 明细时可用；余额满足全部暂停明细的原报价才恢复排队。沿用原价格和请求，不会跳过同渠道待确认任务；每任务补查 / 恢复共限 1 次 / 30 秒。","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"schema":{"type":"string","enum":["order_id","txid"],"description":"明确按平台 order_id 或渠道 txid 查找。省略时兼容两种编号；若同时匹配不同订单，返回 409 AMBIGUOUS_ORDER_IDENTIFIER，必须指定类型后重试。适用于查单、明细、补查、恢复和失败重试。"}}],"requestBody":{"required":false,"description":"无需参数；请求体留空或发送空 JSON 对象，不接受其他字段。","content":{"application/json":{"schema":{"type":"object","additionalProperties":false},"example":{}}}},"responses":{"202":{"description":"已安排处理","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"请求体超过 200,000 字节","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/items/{itemId}/retry":{"post":{"summary":"按原参数重试允许重试的失败明细","description":"需失败且 retryable=true。检查卡号状态和余额，沿用原价格，不修改原参数。续费重试办理前再次核对线路套餐；原请求未固定目标套餐且当前套餐已变化时，明细失败并返回 RENEWAL_PLAN_MISMATCH，不办理、不扣款；已记录明确目标套餐的换套餐续费仍按原目标重试。业务完成后可能产生新的 order.completed 事件，按 event_id 去重。","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id_type","in":"query","required":false,"schema":{"type":"string","enum":["order_id","txid"],"description":"明确按平台 order_id 或渠道 txid 查找。省略时兼容两种编号；若同时匹配不同订单，返回 409 AMBIGUOUS_ORDER_IDENTIFIER，必须指定类型后重试。适用于查单、明细、补查、恢复和失败重试。"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"description":"无需参数；请求体留空或发送空 JSON 对象，不接受其他字段。","content":{"application/json":{"schema":{"type":"object","additionalProperties":false},"example":{}}}},"responses":{"202":{"description":"已安排处理","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Order"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"请求体超过 200,000 字节","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/query-jobs":{"post":{"tags":["查詢"],"operationId":"post_query_jobs","summary":"獨立非同步批次查詢","description":"POST /query-jobs 保存 1–100 條查詢後返回 202。每條線路均按同步查詢的順序核對 ICCID、原登記編號及原手機號碼。錯誤明細以 review、error_code 和 message 返回，result 為 null。所有明細結束後發送 query.job.completed。查詢不收費。","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["txid","items"],"properties":{"txid":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"},"items":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/QueryIdentifiers"}},"webhook_url":{"type":"string","format":"uri","description":"可選的本任務 HTTPS 回呼地址。省略時採用已登記地址；未登記時由平台接收，渠道需查詢原任務。不填 API 地址。"}}}}}},"responses":{"202":{"description":"已保存查詢任務；最終結果以明細為準","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueryJobResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON 請求體超過 200,000 位元組。","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"有請求體時須使用 application/json。","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"請求過於頻繁；依 Retry-After 等待後查詢原任務。","headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"callbacks":{"queryResult":{"{$request.body#/webhook_url}":{"post":{"summary":"接收批次查詢結果","description":"使用 X-RM-Event、X-RM-Delivery-Id 和 X-RM-Signature；對原始 JSON 位元組計算 HMAC-SHA256。依事件 id 去重，回傳 2xx 確認。投遞重試保持相同事件與內容。每個查詢任務只保存最大的 revision，較舊有效事件仍以 2xx 確認，不覆蓋新結果。","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryCompletedEvent"}}}},"responses":{"200":{"description":"已接收"}}}}}},"security":[{"ChannelKey":[]}]}},"/query-jobs/{id}":{"get":{"tags":["查詢"],"operationId":"get_query_job","summary":"讀取原查詢批次","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"本渠道的查詢任務 ID 或原 txid"}],"responses":{"200":{"description":"查詢任務資料","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueryJobResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"請求過於頻繁；依 Retry-After 等待後查詢原任務。","headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ChannelKey":[]}]}},"/query-jobs/{id}/recheck":{"post":{"tags":["查詢"],"operationId":"recheck_query_job","summary":"重查已結案 review 明細","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"本渠道的查詢任務 ID 或原 txid"}],"description":"批次結束後，確認資料已修正才呼叫；進行中的明細不可重啟。只重查 review 明細，保留成功明細與原任務號；完成後以新 revision 和新事件 id 回呼。原登記身份有衝突時仍需處理，不能藉此改綁。","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"202":{"description":"查詢任務資料","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueryJobResult"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON 請求體超過 200,000 位元組。","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"有請求體時須使用 application/json。","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"請求過於頻繁；依 Retry-After 等待後查詢原任務。","headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ChannelKey":[]}]}},"/query-jobs/{id}/callbacks":{"get":{"tags":["查詢"],"operationId":"get_query_callbacks","summary":"查詢批次結果的回呼投遞狀態","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"本渠道的查詢任務 ID 或原 txid"}],"responses":{"200":{"description":"查詢任務資料","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QueryCallback"}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"請求過於頻繁；依 Retry-After 等待後查詢原任務。","headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ChannelKey":[]}]}},"/query-jobs/{id}/callbacks/retry":{"post":{"tags":["查詢"],"operationId":"retry_query_callbacks","summary":"重新投遞失敗的查詢回呼","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"本渠道的查詢任務 ID 或原 txid"}],"description":"自動投遞六次失敗後進入異常。確認接收端恢復後，重新排入原事件，保留投遞次數與記錄；不重查線路，也不重辦業務。","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"202":{"description":"查詢任務資料","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"job_id":{"type":"string"},"requeued":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"參數、權限或任務狀態錯誤","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON 請求體超過 200,000 位元組。","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"有請求體時須使用 application/json。","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"請求過於頻繁；依 Retry-After 等待後查詢原任務。","headers":{"Retry-After":{"schema":{"type":"string","pattern":"^[0-9]+$"}},"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"ChannelKey":[]}]}},"/mdns/{mdn}/overview":{"get":{"summary":"查詢號碼狀態及當期用量餘量","parameters":[{"name":"mdn","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{10}$"}}],"responses":{"200":{"description":"查询完成","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/NumberOverview"}},"required":["success","data"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"同步綜合查詢。不接受查詢參數，請勿傳 from、to、summary 或 mode。先按本渠道登記身份及原帳號核實線路，再以同次線路的當期日期和套餐資源查一次當期用量。line 與 usage 分別保留各自時刻，不代表上游同一瞬間快照。當期與下期分開；有效上游餘量（包括 0）優先，其餘沿用現有當期餘量規則。未知值為 null，不限量以 *_unlimited=true 表示。當期缺失、已到期、未生效或超出可查範圍時，HTTP 200 返回 partial=true、usage=null、USAGE_PERIOD_UNCONFIRMED。未找到線路時保留 found=false，不繼續查用量。上游用量暫不可用時保留線路並返回 usage_error；回包無效／身份或區間不符、歸屬變更、無查詢權限仍按原規則拒絕。不建立非同步查詢任務、訂單、扣款或回呼。原線路及用量介面保持原有行為。","operationId":"getNumberOverview"}},"/cards/lookup":{"post":{"tags":["Inventory"],"summary":"批次本地查庫","description":"僅查本地庫，不呼叫上游、不提交業務、不扣款。同一身份與週期已有確認日期時優先採用；expiry_info 是歷史／推算的已購週期截止，不代表目前線路狀態或即時 service_period。當期查詢不抹去已成功購買的後續週期。依據不足或衝突保持未知。未使用空卡仍僅提供數量。\n\n每批 1–200 個標識，結果保持輸入順序及重複項。未找到或綁定待確認不影響其他條目；格式錯誤拒絕整個請求。不建立查詢任務、回呼或訂單；暫停辦理的唯讀渠道也可使用此 POST。","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","additionalProperties":false,"properties":{"mdn":{"type":"string","pattern":"^\\d{10}$"},"iccid":{"type":"string","pattern":"^\\d{18,22}$"}},"oneOf":[{"required":["mdn"],"not":{"required":["iccid"]}},{"required":["iccid"],"not":{"required":["mdn"]}}]}}}},"example":{"items":[{"mdn":"2025550100"},{"iccid":"89000000000000000001"}]}}}},"responses":{"200":{"description":"本地查詢完成","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"request":{"type":"object","additionalProperties":false,"properties":{"mdn":{"type":"string","pattern":"^\\d{10}$"},"iccid":{"type":"string","pattern":"^\\d{18,22}$"}},"oneOf":[{"required":["mdn"],"not":{"required":["iccid"]}},{"required":["iccid"],"not":{"required":["mdn"]}}]},"found":{"type":"boolean"},"card":{"oneOf":[{"$ref":"#/components/schemas/Card"},{"type":"object","nullable":true,"enum":[null]}]},"error":{"type":"object","nullable":true,"additionalProperties":false,"properties":{"code":{"type":"string","enum":["LOCAL_IDENTITY_UNCONFIRMED"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["request","found","card","error"]}},"summary":{"type":"object","properties":{"requested":{"type":"integer","minimum":0},"found":{"type":"integer","minimum":0},"not_found":{"type":"integer","minimum":0},"needs_review":{"type":"integer","minimum":0}},"required":["requested","found","not_found","needs_review"]},"meta":{"$ref":"#/components/schemas/Meta"},"success":{"type":"boolean"}},"required":["data","summary"]}}}},"400":{"description":"参数错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"凭证无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"渠道停用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"当前渠道无此资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"重复编号内容冲突或状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"需要 JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"限流；按 Retry-After 秒数重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"业务服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}