ทุกอย่างในแดชบอร์ดพาร์ทเนอร์ใช้ผ่าน HTTP ด้วย API key ได้ base URL คือ https://flarestore.vip ทุกการตอบกลับเป็น JSON และมี success จำนวนเงินเป็นจำนวนเต็มหน่วยเซนต์เสมอ

การยืนยันตัวตน

API key ของคุณ

ส่งคีย์เป็น bearer token ในทุกคำขอ หาได้ในแดชบอร์ดที่ การเข้าถึง API คีย์มีรูปแบบ fs_pk_...

# ทุกคำขอมีลักษณะแบบนี้ curl https://flarestore.vip/api/partner/me \ -H "Authorization: Bearer fs_pk_your_key_here"

ดูแลคีย์เหมือนรหัสผ่าน — คีย์ใช้ยอดเงินของคุณได้ หากรั่วไหล ให้หมุนคีย์จากแดชบอร์ด แล้วคีย์เก่าจะใช้ไม่ได้ทันที แดชบอร์ดบนเว็บใช้ session cookie แทน การหมุนคีย์จึงไม่ทำให้คุณออกจากระบบ

การจำกัดอัตรา: GET 120 และ POST 60 ครั้งต่อนาที โดยจำกัดเข้มกว่าสำหรับการเข้าสู่ระบบและการใช้สล็อต (30/นาที) หากเกินจะได้ 429 — รอสักครู่แล้วลองใหม่

บัญชี

ฉันคือใคร

GET /api/partner/me API KEY หรือ SESSION

บัญชีของคุณ: 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 KEY หรือ SESSION

ออก API key ใหม่ คีย์เดิมจะใช้ไม่ได้ทันทีที่คำขอนี้ตอบกลับ จึงควรอัปเดตระบบของคุณก่อนเรียกใช้

แค็ตตาล็อก

สิ่งที่คุณขายได้ และราคาเท่าไร

GET /api/partner/me/catalog API KEY หรือ SESSION

ทุกแพ็กเกจที่เปิดใช้ในบัญชีของคุณพร้อมราคาที่คำนวณแล้ว นี่คือ endpoint สำหรับสร้างหน้าร้านของคุณเอง — คำนวณตามรูปแบบราคาที่บัญชีของคุณใช้ไว้แล้ว

บัญชีราคาส่งจะได้ 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 KEY หรือ SESSION

ยอดรวมพร้อมรายละเอียดแยกตามแพ็กเกจ พันธมิตรจะได้ค่าคอมมิชชันที่ได้รับ จ่ายแล้ว และค้างจ่าย ผู้ซื้อราคาส่งจะได้ยอดใช้จ่ายรวมและยอดเงินปัจจุบัน

GET /api/partner/me/sales API KEY หรือ SESSION

คำสั่งซื้อของคุณ เรียงจากใหม่สุด รับ ?limit= (1–200 ค่าเริ่มต้น 50) และ ?offset= จะไม่มีอีเมลและข้อมูลการชำระเงินของลูกค้า

GET /api/partner/me/payouts API KEY หรือ SESSION

เฉพาะพันธมิตร ประวัติการจ่ายเงินพร้อมยอดที่ค้างจ่ายให้คุณในปัจจุบัน

GET /api/partner/me/certificates API KEY หรือ SESSION

ทุกใบรับรองที่ออกภายใต้คำสั่งซื้อของคุณ เรียงจากใหม่สุด รับ ?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 โดยตรง ข้อมูลคีย์จึงเป็นของพวกเขา ไม่ใช่ของคุณ คุณยังเห็นว่ามีใบรับรองอยู่ แพ็กเกจ และสถานะว่าใช้งานอยู่หรือถูกเพิกถอน

ราคาส่ง

การซื้อและใช้สล็อต

endpoint เหล่านี้ใช้ได้เฉพาะบัญชีราคาส่ง บนบัญชีพันธมิตรจะตอบ 403

GET /api/partner/me/balance API KEY หรือ SESSION

ยอดเงินปัจจุบันของคุณ หน่วยเป็นเซนต์

GET /api/partner/me/ledger API KEY หรือ SESSION

ทุกความเคลื่อนไหวของยอดเงิน — การเติมเงิน การหักค่าสล็อต การคืนเงิน และการปรับยอด — พร้อมยอดเงินหลังแต่ละรายการ

POST /api/partner/me/orders API KEY หรือ SESSION

ใช้หนึ่งสล็อต หักราคาต่อหน่วยของคุณ ลงทะเบียนอุปกรณ์ และเริ่มจัดเตรียม

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

ตอบกลับคำสั่งซื้อ จำนวนที่ถูกหัก ยอดเงินใหม่ และ access token ที่ลูกค้าใช้รับใบรับรอง:

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

การจัดเตรียมเป็นแบบอะซิงโครนัส ให้ poll status_url หรือ /me/orders/{order_id} จนกว่าใบรับรองจะพร้อม หากเริ่มการจัดเตรียมไม่ได้ ยอดเงินจะคืนให้อัตโนมัติ — คุณจะไม่ถูกเรียกเก็บเงินสำหรับสล็อตที่ไม่ได้รับ

การลองใหม่และคำสั่งซื้อซ้ำ ส่ง header Idempotency-Key (1–200 ตัวอักษรที่พิมพ์ได้ ไม่มีช่องว่าง ไม่ซ้ำกันต่อคำสั่งซื้อ เช่น UUID) เพื่อไม่ให้คำขอที่ลองใหม่ซื้อสล็อตซ้ำ การส่งคีย์เดิมพร้อม body เดิมจะได้การตอบกลับเดิมโดยไม่เปลี่ยนแปลงและไม่หักเงินซ้ำ พร้อม header Idempotent-Replayed: true คีย์เดิมกับ body ต่างกันจะถูกปฏิเสธด้วย 422 ขณะที่คำขอแรกยังทำงานอยู่ การส่งซ้ำจะได้ 409 คำขอที่ล้มเหลวจะปล่อยคีย์คืน คีย์จะถูกเก็บไว้ 7 วัน

หากไม่มีคีย์ การใช้ UDID เดิมกับแพ็กเกจเดิมซ้ำภายใน 10 นาทีจะได้คำสั่งซื้อเดิมแทนคำสั่งซื้อใหม่: charged เป็น 0, duplicate_of ระบุคำสั่งซื้อ และตั้ง Idempotent-Replayed: true คำสั่งซื้อที่คืนเงินหรือล้มเหลวไม่นับ หากคุณตั้งใจใช้กับอุปกรณ์เดิมซ้ำอย่างรวดเร็ว ขอให้เราปิดฟีเจอร์นี้สำหรับบัญชีของคุณ

POST /api/partner/me/signing-settings API KEY หรือ SESSION

ถามก่อนเซ็น 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 นาทีด้านบนยังทำงานก่อน การลองซ้ำแบบเดิมทุกประการภายใน 10 นาทีจึงได้คำสั่งซื้อเดิม (ไม่หักเงิน) แม้จะมี confirm_resign

GET /api/partner/me/orders/{order_id} API KEY หรือ SESSION

สถานะของคำสั่งซื้อของคุณเอง รวมถึงสถานะอุปกรณ์และการจัดเตรียม คำสั่งซื้อของพาร์ทเนอร์อื่นจะตอบ 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คำขอไม่ถูกต้อง — ฟิลด์ขาดหายหรือรูปแบบผิดตรวจสอบ body ข้อความจะระบุปัญหา
401ไม่มีข้อมูลยืนยันตัวตนส่ง header Authorization
402ยอดเงินไม่พอเติมเงิน ข้อความจะระบุจำนวนที่ขาด
403คีย์ไม่ถูกต้อง หรือประเภทบัญชีไม่ตรงกับ endpointตรวจสอบคีย์และรูปแบบบัญชีของคุณ
404ไม่พบ หรือไม่ใช่ของคุณตรวจสอบว่า ID เป็นของบัญชีคุณ
409แพ็กเกจใช้ไม่ได้ในขณะนี้ลองใหม่ภายหลังหรือเลือกแพ็กเกจอื่น
409คุณเคยเซ็น UDID นี้แล้ว (เปิดการถามก่อนเซ็นซ้ำอยู่) — already_signedหากตั้งใจ ให้ส่งใหม่พร้อม "confirm_resign": true
429ถูกจำกัดอัตรารอสักครู่แล้วลองใหม่
500ความผิดพลาดของเราคุณไม่ถูกเรียกเก็บเงิน ลองใหม่ แล้วแจ้งเรา

ข้อผิดพลาดมี detail ที่อ่านเข้าใจได้ — บันทึกไว้ เพราะมักบอกได้ตรงว่าผิดอะไร