合作夥伴儀表板中的所有功能,都能用你的 API 金鑰透過 HTTP 使用。基礎網址為 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、顯示名稱、帳號類型、餘額和推薦網址。

{ "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 密碼和下載網址:

{ "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(Beta):方案 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——請記錄下來,它通常會明確指出問題所在。