API 参考激活码
查询激活码
POSThttps://api.astrum.shop/v1/keys/lookup
权限范围 keys:read
按激活码本身查询——适用于手上只有激活码、没有编号的情况:比如客户把激活码发给了客服。每次最多 100 个激活码;响应按相同顺序,每个激活码一行。
您店铺的激活码返回 found 和完整的激活码信息,与 GET /v1/keys/ 相同。其他店铺的或不存在的激活码返回 not_found,输入有误返回 typo。
请求体
application/jsoncodes
array · 必填
要查询的激活码,1 到 100 个。格式随意:大小写、连字符和空格不影响结果。
响应
results
array
每个发送的激活码一行,顺序相同。
↳code
string
激活码——与您发送的一致。
↳result
string
激活码的情况:
found- 您店铺的激活码,
key中是完整的激活码信息,与GET /v1/keys/相同{key_id} not_found- 您的店铺没有这个激活码
typo- 不是激活码:长度不对、含有无效字符或校验位不符
↳key
object | null
result 为 found 时为完整的激活码信息,否则为 null。
↳key_id
string
激活码在我们这里的编号——用于 GET /v1/keys/。
↳code
string | null
交给客户的激活码:XXXX-XXXX-XXXX-XXXX。
↳link
string | null
开通页面链接——激活码会自动填入。
↳status
string
激活码状态:
available- 未使用——可以交给客户
activating- 客户已提交信息,正在开通
activated- 订阅已开通
expired- 已作废——未在有效期内激活
refunded- 价格已退回余额
↳product_id
string
↳title
string
套餐名称。
↳delivery_method
string
↳kind
string | null
↳subscription_days
integer | null
↳price_usdt
string
激活码的价格——为它扣除的金额。
↳ref
string | null
购买时传入的您那边的订单号。
↳created_at
string
↳expires_at
string
未激活时的作废时间:购买后 45 天。
↳activated_at
string | null
↳warranty_until
string | null
质保截止时间(自激活起 7 天)。
↳last_attempt_failed_at
string | null
最近一次开通未成功的时间——此后激活码重新变为未使用。
↳last_attempt_reason
string | null
最近一次尝试未成功的原因:
verification_declined- 客户拒绝了身份验证
not_activated- 未能开通订阅,尝试已关闭
null — 没有失败的尝试。
所有接口通用的错误,详见「错误码」章节:
10001 invalid_key10002 key_scope_missing10003 ip_not_allowed10004 browser_not_allowed10005 account_suspended20001 too_many_requests90002 api_disabled90001 internal_error
