合作伙伴控制台中的所有功能都可以用你的 API 密钥通过 HTTP 使用。基础 URL 为https://flarestore.vip。所有响应均为 JSON,并带有success字段。金额始终是以美分 (cents)为单位的整数。

认证

你的 API 密钥

每个请求都需将你的密钥作为 Bearer Token 发送。你可以在控制台的API 访问中找到它。密钥格式类似fs_pk_...。

# 每个请求都是这样的 curl https://flarestore.vip/api/partner/me \ -H "Authorization: Bearer fs_pk_your_key_here"

请像对待密码一样对待密钥——它可以花费你的余额。如有泄露,请在控制台中轮换,旧密钥会立即失效。网页控制台使用会话 Cookie,因此轮换密钥不会让你退出登录。

速率限制:每分钟 120 次 GET 和 60 次 POST,登录和名额兑换的限制更严格(30 次/分钟)。超出限制会返回429——请稍后重试。

账户

我是谁

GET /api/partner/me API 密钥或会话

你的账户:slug、显示名称、账户类型、余额和推荐 URL。

{ "success": true, "partner": { "slug": "yourname", "display_name": "Your Name", "account_type": "wholesale", "balance": 4250, "referral_url": "https://flarestore.vip/p/yourname" } }
POST /api/partner/me/api-key/rotate API 密钥或会话

签发新的 API 密钥。此请求返回的瞬间旧密钥即失效,因此请在调用前更新你的集成。

目录

你能卖什么,卖多少钱

GET /api/partner/me/catalog API 密钥或会话

你账户上启用的所有套餐及最终价格。搭建你自己的店面时应以此接口为准——它已考虑了你账户采用的定价模式。

批发账户返回your_price:

{ "account_type": "wholesale", "plans": [ { "plan_id": "standard", "name": "Standard", "your_price": 600, "orderable": true }, { "plan_id": "ios_6m", "name": "iOS 6M Protection", "your_price": 1200, "orderable": true } ] }

联盟账户则返回customer_price和your_commission:

{ "account_type": "affiliate", "plans": [ { "plan_id": "standard", "name": "Standard", "customer_price": 900, "your_commission": 135 } ] }

orderable: false表示该套餐已列出但目前无法兑换——在它变为 true 之前,请不要向客户提供。

报表

销售、收入和证书

GET /api/partner/me/stats API 密钥或会话

总计及按套餐细分。联盟推广者可获得已赚、已发放和应付佣金;批发商可获得总支出和当前余额。

GET /api/partner/me/sales API 密钥或会话

你的订单,最新的在前。支持?limit=(1–200,默认 50)和?offset=。永远不会包含客户邮箱和付款信息。

GET /api/partner/me/payouts API 密钥或会话

仅限联盟账户。佣金发放记录及当前应付给你的余额。

GET /api/partner/me/certificates API 密钥或会话

你订单下签发的所有证书,最新的在前。支持?limit=(1–200,默认 100)、?offset=和?include_revoked=true。

返回内容取决于你的模式。批发账户自行为客户交付,因此每一行都带有 p12 密码和下载 URL:

{ "cert_id": "a1b2c3d4e5f6", "cert_type": "distribution", "status": "active", "udid": "00008030-001A2B3C4D5E6F70", "plan_name": "Standard", "order_id": "A1B2C3D4", "p12_password": "...", "p12_url": "/api/cert/a1b2c3d4e5f6/p12?udid=...", "provision_urls": ["/api/cert/a1b2c3d4e5f6/provision/0?udid=..."] }

联盟账户获得的行相同,但不含p12_password、p12_url或provision_urls——这些客户是直接从 FlareStore 购买的,因此密钥材料归他们所有,而不是你。你仍能看到证书存在、其套餐,以及它是有效还是已吊销。

批发

购买和兑换名额

这些接口仅限批发账户。在联盟账户上调用会返回403。

GET /api/partner/me/balance API 密钥或会话

你的当前余额,单位为美分。

GET /api/partner/me/ledger API 密钥或会话

每一笔余额变动——充值、名额扣款、退款和调整——以及变动后的余额。

POST /api/partner/me/orders API 密钥或会话

兑换一个名额。按你的单价扣款,注册设备并开始配置。

curl -X POST https://flarestore.vip/api/partner/me/orders \ -H "Authorization: Bearer fs_pk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"plan_id": "standard", "udid": "00008030-001A2B3C4D5E6F70"}'
curl -X POST https://flarestore.vip/api/partner/me/orders \ -H "Authorization: Bearer fs_pk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"plan_id": "watch", "udid": "00008030-001A2B3C4D5E6F70", "watch_udid": "00008310-000F45D03A7A601E"}'

iPhone + Apple Watch(测试版):套餐watch还需要watch_udid(已配对的 Apple Watch)。两台设备会一起注册到同一张证书中;udid为 iPhone。这一对设备的 UDID 之后无法更改:更换 iPhone 或 Watch 需要新的名额。订单信息中包含watch_udid。

返回订单、扣款金额、你的新余额,以及客户用来领取证书的访问令牌:

{ "success": true, "order_id": "A1B2C3D4", "charged": 600, "balance": 3650, "access_token": "...", "status_url": "https://flarestore.vip/api/order-status?token=..." }

配置是异步进行的。请轮询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。已退款或失败的订单不计入。如果你确实需要快速为同一设备重新兑换,请让我们为你的账户关闭此功能。

POST /api/partner/me/signing-settings API 密钥或会话

再次签名 UDID 前询问。默认关闭:一个 UDID 可以签名任意次数。开启后,POST /me/orders会拒绝你已签过的 UDID(任何套餐、任何日期;已退款或失败的订单不计入),返回409及"error": "already_signed",且不扣费。带上"confirm_resign": true再次发送同一请求即可照常签名。与经销商面板中“账户 › 再次签名同一 UDID”是同一开关。

curl -X POST https://flarestore.vip/api/partner/me/signing-settings \ -H "Authorization: Bearer fs_pk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"ask_before_resign": true}'

GET返回当前值。仅限批发账户。

409 响应会列出你此前针对该 UDID 的订单,最新的在前:

{ "success": false, "error": "already_signed", "detail": "You already signed this UDID (order A1B2C3D4). You were not charged. ...", "count": 1, "orders": [{ "order_id": "A1B2C3D4", "plan_id": "basic", "created_at": "2026-11-22T15:28:00Z", "seconds_ago": 120 }] }

上述 10 分钟重复保护仍会优先执行,因此即使带有 confirm_resign,10 分钟内完全相同的重试也会返回现有订单(不扣费)。

GET /api/partner/me/orders/{order_id} API 密钥或会话

你自己某个订单的状态,包括设备和配置状态。属于其他合作伙伴的订单会返回404。

WHOLESALE

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.

POST /api/partner/me/orders API KEY OR SESSION

Add "note" when you redeem. A note that is too long is refused with 400 before anything is charged.

curl -X POST https://flarestore.vip/api/partner/me/orders \ -H "Authorization: Bearer fs_pk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"plan_id": "standard", "udid": "00008030-001A2B3C4D5E6F70", "note": "Ali K. / shop order 5521"}'
PUT /api/partner/me/notes API KEY OR SESSION

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.

curl -X PUT https://flarestore.vip/api/partner/me/notes \ -H "Authorization: Bearer fs_pk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"cert_id": "c36f52ee-d31", "note": "replacement sent 30 Nov"}'

GET /api/partner/me/notes?udid=… (or ?order_id= / ?cert_id=) reads them back:

{ "success": true, "count": 1, "notes": [{ "order_id": "A1B2C3D4", "receipt_number": "FSW1234-5678", "udid": "00008030-001A2B3C4D5E6F70", "cert_ids": ["c36f52ee-d31"], "note": "replacement sent 30 Nov", "note_updated_at": "2026-11-30T12:00:00Z" }] }

Per order: GET, PUT ({"note": "..."}) and DELETE /api/partner/me/orders/{order_id}/note.

WHOLESALE

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.

POST /api/partner/me/sign API KEY OR SESSION

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.

curl -X POST https://flarestore.vip/api/partner/me/sign \ -H "Authorization: Bearer fs_pk_your_key_here" \ -H "Content-Type: application/json" \ -d '{"cert_id": "c36f52ee-d31", "ipa_url": "https://example.com/MyApp.ipa"}'
{ "success": true, "install_url": "https://flarestore.app/i/abc123", "cert_id": "c36f52ee-d31", "order_id": "A1B2C3D4" }

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字段——请记录下来,它通常会准确说明问题所在。