Xtore API
מפתח
בעלים או מנהל יוצרים מפתח במסך «חיבור מערכות (API)» של הארגון. המפתח פועל רק בארגון שלו, מוצג פעם אחת, ונשמר אצלנו רק כטביעת אצבע. אפשר לבטל אותו בכל רגע.
Authorization: Bearer xk_XXXXXXXX_…
כל תשובה היא JSON: {"ok": true, "data": …} או {"ok": false, "error": "…"}, עם הסיבה בעברית. מזהה הארגון (ORG) מופיע בכתובת המסך: /o/ORG.
ספק: קטלוג ומחירים
GET /api/o/ORG/products # the catalog
POST /api/o/ORG/products {"name","price","sku","brand","category","unit","pack","case_qty","min_qty","active"}
PATCH /api/o/ORG/products/ID {"price": 9.9}
POST /api/o/ORG/products/import {"csv": "…"} or {"xlsx": "<base64>"} # a row with a known SKU updates it
GET /api/o/ORG/pricelists · PUT /api/o/ORG/pricelists/ID/items {"items":[{"product_id","price"}]}
PUT /api/o/ORG/customers/LINK/prices {"items":[{"product_id","price"}]} # one customer's own prices
POST /api/o/ORG/promotions {"title","kind":"percent|price|bonus|tier|xfor","params":{…},"product_id","starts_on","ends_on"}
ספק: הזמנות, מסמכים ותשלומים
GET /api/o/ORG/orders?status=pending_supplier
GET /api/o/ORG/orders/ID
POST /api/o/ORG/orders/ID/action {"action":"approve|reject|propose|process|ship|deliver|cancel","note","items":[{"id","qty","unit_price"}]}
POST /api/o/ORG/files (the file as the body; header X-Filename) → {"id"}
POST /api/o/ORG/invoices {"business_id","number","doc_type":"tax_invoice|invoice_receipt|receipt|credit_note|delivery_note",
"total","amount","issued_on","due_on","allocation","order_id":"ORG-12","file_id"}
GET /api/o/ORG/payments · POST /api/o/ORG/payments/ID/decide {"decision":"confirmed|rejected"}
GET /api/o/ORG/customers · POST /api/o/ORG/customers/import {"csv"|"xlsx"}
GET /api/o/ORG/documents?month=2026-11 · GET /api/o/ORG/export?month=2026-11 (ZIP for the accountant)
חנות
GET /api/o/ORG/suppliers
GET /api/o/ORG/catalog/SUPPLIER # at YOUR prices, with promotions
POST /api/o/ORG/orders {"supplier_id","items":[{"product_id","qty"}],"notes","delivery_date","submit":true}
GET /api/o/ORG/invoices · POST /api/o/ORG/payments {"supplier_id","invoice_id","amount","method","reference"}
דוגמה
curl -s -H "Authorization: Bearer $XTORE_KEY" \ "https://app.xtore.co.il/api/o/ORG/orders?status=pending_supplier"
כללים
- מחירים לפני מע״מ; המחיר האפקטיבי: מחיר ללקוח ← המחירון שלו ← ברירת המחדל.
- מוצר בלי מחיר מוצג אך לא ניתן להזמנה. חשבונית מס מ-₪5,000 לפני מע״מ — עם מספר הקצאה (9 ספרות).
- שום דבר לא נמחק: מוצר נעשה לא פעיל, לקוח מושהה, מפתח מבוטל. כל כתיבה נרשמת ביומן.