חיבור BuyPost לכלי AI ולסוכנים
עם ה-API של BuyPost, כלי AI או מערכת אוטומציה יכולים לקרוא את המחירון, לשלוח הזמנות של כתבות ממומנות, לעקוב אחריהן ולאשר או לתקן אותן — מהחשבון ומהקרדיטים שלכם. התשלום עצמו תמיד נעשה כאן באתר.
לכלי AI: המפרט המלא — customer-api-openapi.json, מדריך טקסט — customer-api.txt, ותקציר האתר — llms.txt.
למפתחים: כל הפעולות, השדות והשגיאות — מדריך למפתחים.
איך מקבלים גישה — 4 צעדים
- שולחים בקשה בעמוד API באזור האישי. מיד מגיע מייל שהבקשה התקבלה.
- אנחנו מאשרים, בדרך כלל תוך יום עסקים. מגיע מייל שהגישה אושרה, עם הסבר מה עושים עכשיו.
- יוצרים מפתח באותו עמוד. המפתח מוצג פעם אחת — שומרים אותו בשרת כמשתנה
BUYPOST_API_KEY. - מחברים את הכלי שלכם לפי המדריך למטה, ומריצים בדיקת חיבור.
פרטי החיבור
- כתובת
POST https://ai.buypost.co.il/functions/customerApi- הזדהות
- כותרת
Authorization: Bearer bp_live_…— מפתח אחד, בלי שם משתמש נפרד - גוף הבקשה
- JSON עם
action, למשל{"action":"ping"} - עדכונים אוטומטיים
- webhook חתום, עם סוד חתימה שמוצג פעם אחת
- מגבלות
- 10 בקשות בדקה, 300 ביום לחשבון
מדריך לפי כלי — Claude Code, ChatGPT, Cursor, n8n
- בתיקיית הפרויקט שלכם, שמרו את המפתח בקובץ
.envבשורהBUYPOST_API_KEY=bp_live_...והוסיפו את.envל-.gitignore. - הפעילו במסוף את
claudeבתיקיית הפרויקט והדביקו את ההוראה למטה. Claude Code קורא את התיעוד המלא, כותב את הקוד ומריץ בדיקת חיבור. - כדי שיזכור את הכללים גם בפעם הבאה: בקשו ממנו "תוסיף את הכללים של BuyPost ל-CLAUDE.md".
ההוראה להדבקה:
Build an integration with the BuyPost customer API (sponsored articles on Israeli news and content websites). Read first: the OpenAPI 3.1 spec https://ai.buypost.co.il/customer-api-openapi.json and the guide for AI agents https://ai.buypost.co.il/customer-api.txt Endpoint: POST https://ai.buypost.co.il/functions/customerApi with a JSON body that contains "action". Auth: header "Authorization: Bearer <key>". Read the key from the environment variable BUYPOST_API_KEY, on the server only — never in browser code, never in the repository, never in this chat. Build: 1. A small client: buypost(action, params) → returns data, or throws with error.code / error.message / error.hint. 2. Price list: price_list (cache it for a day). Show price_before_vat (my price), price_source, writing_notes, publishing_restrictions, requires_shared_fields, example_articles and the price list's general_restrictions. 3. Order form: quote first, then create_order with a unique idempotency_key. On validation_failed show error.message and mark every details[].errors[].field. Orders are created UNPAID — I pay on the BuyPost site (payment.pay_at). 4. Tracking: list_orders (past orders and their status) and list_items with updated_since (only changes). For each article show progress.label and progress.next_step, and only the buttons listed in available_actions (approve, request_fix, submit_edit, ai_fix, replace_file, reject_content, cancel, update_item / redeem). waiting_for_you = I have to act. 5. A webhook endpoint: verify X-BuyPost-Signature = sha256=HMAC_SHA256(signing secret, X-BuyPost-Timestamp + "." + raw body), reject timestamps older than 5 minutes, answer 2xx within 5 seconds, then update the local state by the event type. Limits: 10 requests per minute and 300 per day for the whole account — no polling loops; use get_items for several articles. Finally call the ping action to prove the connection works.
המפרט המלא (שכלי AI קוראים):
https://ai.buypost.co.il/customer-api-openapi.json
מדריך טקסט לכלי AI:
https://ai.buypost.co.il/customer-api.txt
לעולם אל תדביקו את המפתח עצמו בצ'אט של כלי ה-AI — הכלי צריך רק את שם משתנה הסביבה. מפתח שנחשף בטעות מבטלים כאן בלחיצה ויוצרים חדש.
מה אפשר לעשות דרך ה-API
| פעולה | מה היא עושה |
|---|---|
ping |
בדיקת חיבור |
balance |
יתרת קרדיטים, מגבלות, מה ממתין לכם |
price_list |
המחירון עם המחירים שלכם וכל פרטי האתרים |
quote |
הצעת מחיר ובדיקת פרטים — בלי ליצור הזמנה |
create_order |
הזמנה חדשה (ממתינה לתשלום באתר) |
list_orders |
כל ההזמנות — מהאתר ומה-API — עם הסטטוס |
get_order |
הזמנה אחת |
list_items / get_items / get_item |
הכתבות, השלב של כל אחת והטקסט לקריאה |
list_redeemable |
מה נקנה ועדיין לא מומש |
approve |
אישור כתבה |
request_fix |
בקשת תיקון מהצוות |
ai_fix |
תיקון ב-AI לפי ההוראות שלכם |
submit_edit |
עריכה עצמית של הטקסט |
replace_file |
החלפה בקובץ Word |
reject_content |
דחייה וכתיבה מחדש |
cancel |
ביטול (בשלבים שהאתר מאפשר) |
update_item / redeem |
שינוי פרטים או מימוש כתבה שנקנתה מראש |
רק באתר: תשלום וקניית קרדיטים, הגדרת עדכונים אוטומטיים, ואישור טיוטה שאתר המפרסם העלה.
For AI agents
BuyPost customer API — summary for AI agents What it is: an API for approved BuyPost customers to read the price list (with their own prices), submit orders of sponsored articles on Israeli news and content websites, and track, approve or fix those articles. Endpoint: POST https://ai.buypost.co.il/functions/customerApi — JSON body with "action". Auth: header "Authorization: Bearer bp_live_..." (one key; there is no separate username). Server side only. Spec (OpenAPI 3.1): https://ai.buypost.co.il/customer-api-openapi.json Guide for agents (plain text): https://ai.buypost.co.il/customer-api.txt How a customer gets access: request on https://ai.buypost.co.il/ApiAccess → BuyPost approves (both steps are emailed) → the customer creates a key on that page (shown once) → stores it as BUYPOST_API_KEY. Rules an agent must follow: - Never ask the user to paste the key into a chat; read it from the environment. - Orders are created UNPAID. Payment happens only on the BuyPost site (payment.pay_at). The API cannot charge money. - Send a unique idempotency_key with every create_order; a retry with the same key never duplicates. - Run quote before create_order. On validation_failed, show error.message and the field of every details[].errors[]. - Show only the buttons in each article's available_actions. waiting_for_you = the customer has to act. - A website draft (stage website_draft_for_you) is approved on the BuyPost site, not through the API. - ai_fix rewrites an article by the customer's instructions: up to 5 per article, 20 per 24 hours. - Limits: 10 requests per minute, 300 per day per account. Use webhooks, list_items with updated_since and get_items — no polling loops. - Webhooks are signed: X-BuyPost-Signature = sha256=HMAC_SHA256(signing secret, X-BuyPost-Timestamp + "." + raw body).
שאלות נפוצות
- יש שם משתמש וסיסמה?
- לא בנפרד. יש מפתח API אחד (bp_live_…) שהוא שם המשתמש והסיסמה ביחד. יוצרים אותו בעמוד API באזור האישי, והוא מוצג פעם אחת בלבד — מסיבות אבטחה הוא לא נשלח במייל.
- כלי AI יכול לחייב אותי?
- לא. כל הזמנה שנוצרת דרך ה-API ממתינה לתשלום, ומשלמים רק באתר — בקרדיטים או בכרטיס.
- מה זה סוד החתימה?
- סוד שמוצג פעם אחת כשמגדירים כתובת לעדכונים אוטומטיים (webhook). השרת שלכם משתמש בו כדי לוודא שכל הודעה באמת באה מ-BuyPost.
- כמה בקשות מותר?
- עד 10 בדקה ו-300 ביום לחשבון, כל המפתחות יחד. עדכונים אוטומטיים, get_items ו-updated_since חוסכים בקשות.
- מפתח דלף. מה עושים?
- מבטלים אותו בעמוד API בלחיצה ויוצרים חדש. הביטול נכנס לתוקף מיד.