合作伙伴控制台中的所有功能都可以用你的 API 密钥通过 HTTP 使用。基础 URL 为https://flarestore.vip。所有响应均为 JSON,并带有success字段。金额始终是以美分 (cents)为单位的整数。
你的 API 密钥
每个请求都需将你的密钥作为 Bearer Token 发送。你可以在控制台的API 访问中找到它。密钥格式类似fs_pk_...。
请像对待密码一样对待密钥——它可以花费你的余额。如有泄露,请在控制台中轮换,旧密钥会立即失效。网页控制台使用会话 Cookie,因此轮换密钥不会让你退出登录。
速率限制:每分钟 120 次 GET 和 60 次 POST,登录和名额兑换的限制更严格(30 次/分钟)。超出限制会返回429——请稍后重试。
我是谁
你的账户:slug、显示名称、账户类型、余额和推荐 URL。
签发新的 API 密钥。此请求返回的瞬间旧密钥即失效,因此请在调用前更新你的集成。
你能卖什么,卖多少钱
你账户上启用的所有套餐及最终价格。搭建你自己的店面时应以此接口为准——它已考虑了你账户采用的定价模式。
批发账户返回your_price:
联盟账户则返回customer_price和your_commission:
orderable: false表示该套餐已列出但目前无法兑换——在它变为 true 之前,请不要向客户提供。
销售、收入和证书
总计及按套餐细分。联盟推广者可获得已赚、已发放和应付佣金;批发商可获得总支出和当前余额。
你的订单,最新的在前。支持?limit=(1–200,默认 50)和?offset=。永远不会包含客户邮箱和付款信息。
仅限联盟账户。佣金发放记录及当前应付给你的余额。
你订单下签发的所有证书,最新的在前。支持?limit=(1–200,默认 100)、?offset=和?include_revoked=true。
返回内容取决于你的模式。批发账户自行为客户交付,因此每一行都带有 p12 密码和下载 URL:
联盟账户获得的行相同,但不含p12_password、p12_url或provision_urls——这些客户是直接从 FlareStore 购买的,因此密钥材料归他们所有,而不是你。你仍能看到证书存在、其套餐,以及它是有效还是已吊销。
购买和兑换名额
这些接口仅限批发账户。在联盟账户上调用会返回403。
你的当前余额,单位为美分。
每一笔余额变动——充值、名额扣款、退款和调整——以及变动后的余额。
兑换一个名额。按你的单价扣款,注册设备并开始配置。
iPhone + Apple Watch(测试版):套餐watch还需要watch_udid(已配对的 Apple Watch)。两台设备会一起注册到同一张证书中;udid为 iPhone。这一对设备的 UDID 之后无法更改:更换 iPhone 或 Watch 需要新的名额。订单信息中包含watch_udid。
返回订单、扣款金额、你的新余额,以及客户用来领取证书的访问令牌:
配置是异步进行的。请轮询status_url或/me/orders/{order_id},直到证书准备就绪。如果无法开始配置,余额会自动退回——你绝不会为没有得到的名额付费。
重试与重复订单。发送Idempotency-Key请求头(1–200 个可打印字符,不含空格,每个订单唯一,例如 UUID),这样重试的请求就不会重复购买名额。使用相同的密钥和相同的请求体重复发送,会原样返回原始响应,不会再次扣款,并带有请求头Idempotent-Replayed: true。相同的密钥但请求体不同会被拒绝并返回422;第一个请求仍在处理时,重复请求会返回409。失败的请求会释放其密钥。密钥保留 7 天。
如果不带密钥,在 10 分钟内对同一套餐再次兑换同一 UDID,会返回现有订单而非新订单:charged为0,duplicate_of指明该订单,并设置Idempotent-Replayed: true。已退款或失败的订单不计入。如果你确实需要快速为同一设备重新兑换,请让我们为你的账户关闭此功能。
再次签名 UDID 前询问。默认关闭:一个 UDID 可以签名任意次数。开启后,POST /me/orders会拒绝你已签过的 UDID(任何套餐、任何日期;已退款或失败的订单不计入),返回409及"error": "already_signed",且不扣费。带上"confirm_resign": true再次发送同一请求即可照常签名。与经销商面板中“账户 › 再次签名同一 UDID”是同一开关。
GET返回当前值。仅限批发账户。
409 响应会列出你此前针对该 UDID 的订单,最新的在前:
上述 10 分钟重复保护仍会优先执行,因此即使带有 confirm_resign,10 分钟内完全相同的重试也会返回现有订单(不扣费)。
你自己某个订单的状态,包括设备和配置状态。属于其他合作伙伴的订单会返回404。
Notes on orders, UDIDs and certificates
Keep your own reference (customer name, your order number…) with each slot. A note is plain
text, up to 500 characters, private to your account: your customer never sees it. It belongs to the
order, so it covers that UDID and every certificate issued on it. It is returned as
note in /me/sales,
/me/orders/{order_id}, /me/certificates
and /me/recent-redeems. Control and invisible characters are removed;
an empty note clears it. Wholesale accounts only; an order that isn't yours is a
404.
Add "note" when you redeem. A note that is too long is refused
with 400 before anything is charged.
Set or change a note later. Name the slot with exactly one of
order_id, cert_id or
udid. A UDID you redeemed more than once answers
409 several_orders with the order ids:
send one of them, or "all": true to note every order of that UDID.
GET /api/partner/me/notes?udid=… (or
?order_id= / ?cert_id=) reads them back:
Per order: GET, PUT
({"note": "..."}) and DELETE
/api/partner/me/orders/{order_id}/note.
Sign an app from an IPA URL
Sign any IPA with one of your certificates without downloading or uploading anything: send the link, get an install link back.
Body: ipa_url plus cert_id (or
order_id: its active distribution certificate is used first).
Optional bundle_id, app_name. The
certificate must be an active one of yours.
The link must be https:// on port 443, publicly reachable, and
lead (after at most 5 redirects) to the .ipa itself; max 500 MB, downloaded within 10 minutes.
Links to private, internal or cloud-metadata addresses, links with a user name or password,
archives that unpack to more than 8 GB, have more than 200,000 files, look like zip bombs or
contain unsafe paths are refused with 400 (too large:
413). One signing at a time per account and 30 per hour
(429 above that). The install link stays valid for 48 hours.
状态码
| 代码 | 含义 | 处理方法 |
|---|---|---|
| 400 | 错误请求——字段缺失或格式错误 | 检查请求体;错误消息会指出问题 |
| 401 | 缺少凭据 | 发送 Authorization 请求头 |
| 402 | 余额不足 | 充值;错误消息会说明差额 |
| 403 | 密钥无效,或账户类型与接口不符 | 检查密钥和你的模式 |
| 404 | 未找到,或不属于你 | 确认该 ID 属于你的账户 |
| 409 | 该套餐目前无法兑换 | 稍后重试或选择其他套餐 |
| 409 | 你已签名过该 UDID(已开启再次签名前询问)——already_signed | 如果确有此意,请带上"confirm_resign": true重新发送 |
| 429 | 请求过于频繁 | 稍等后重试 |
| 500 | 我们的问题 | 你没有被扣费。请重试,然后告诉我们 |
错误会带有易读的detail字段——请记录下来,它通常会准确说明问题所在。